#development

1 messages · Page 1359 of 1

indigo flax
#

so like

#

function funTranslation(text, emoji){
if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
if (text.length > 200) { return msg.channel.createMessage(text); }
msg.channel.createMessage({ embed: {
color: 0xFFFFFF,
description: emoji+" "+text - message.member.mention
}});

digital ibex
#

yes

#

no actually

indigo flax
#

?

digital ibex
#

add a " " around the - and add + around the minus

indigo flax
#

i want it to say like

#

🏴󠁧󠁢󠁥󠁮󠁧󠁿 Hello - @indigo flax

#

like that

digital ibex
#

ik

#

thats why add a "-" around the minus

#

and add + on either side

boreal iron
#

description: emoji + " " + text + " - " + message.member.mention

digital ibex
#

:///////////////////

indigo flax
#
      if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
      if (text.length > 200) { return msg.channel.createMessage(text); }
      msg.channel.createMessage({ embed: {
        color: 0xFFFFFF,
        description: emoji+" "+text + "-" + ${message.member.mention}
      }});```
digital ibex
#

sure

indigo flax
#

didnt work

digital ibex
#

code?

indigo flax
#
      if(text == "" || text == null || text == undefined || text.includes("<!DOCTYPE")) return msg.channel.createMessage("Translation failed.");
      if (text.length > 200) { return msg.channel.createMessage(text); }
      msg.channel.createMessage({ embed: {
        color: 0xFFFFFF,
        description: emoji+" "+text + " - " + message.member.mention
      }});
    }```
boreal iron
#

Does the property message.member.mention even contain the <@! ... > code?

digital ibex
#

did u save?

indigo flax
#

yes

#

wait

digital ibex
#

works for me

boreal iron
#

Is the object name really message.member.mention or probably msg.member.mention ?

digital ibex
#

what?

boreal iron
#

How is that not understandable?

#

Looks like he defined msg as const, not message

opal plank
#

i dont think mention is a thing

#

to grab a member mention you'd have to member.user.toString()

digital ibex
#

it is

#

that returns an object

#

he's using eris btw

opal plank
#

OH

#

nvm me

digital ibex
#

Looks like he defined msg as const, not message
@boreal iron it can be whatever u want it to be, if he doesn't understand it then thats his problem

boreal iron
#

I know since the basic question for the object name seems to be to hard to understand...

digital ibex
#

why is message hard to understand

#

msg is short for message

wicked pivot
#

how to use discord webhooks with axios post method?

var axios = require('axios')
var url = "https://discord.com/api/webhooks/.../...."
var content = "ok"
axios(this, {
    method: "POST",
    url,
    headers: {
        "Content-Type": "application/json"
    },
    data: {
        content
    }
})```
quartz kindle
#

people who are new to programming usually have trouble understanding variable names and how to work with them

#

as they think these names are somehow hardcoded globals

boreal iron
#

aye but posting the result will not really bring them forward

earnest phoenix
#

There a error

halcyon pecan
#

Anyone code in .NET core and could help me with something?

digital ibex
#

@wicked pivot r u trying to send a webhook?

wicked pivot
#

yes

boreal iron
#

@wicked pivot #topgg-api But what do wanna do? Sending server_count ?

earnest phoenix
#

My bot is saying 1+1=3 but the math code should make the bot do 1+1=2

digital ibex
#

/channels/<channelID>/webhooks

earnest phoenix
#

I

halcyon pecan
#

Ugh

earnest phoenix
#

Ugly

indigo flax
#

works for me
@digital ibex

#

u added

#

a

#

and

digital ibex
#

i didnt change anything apart from msg to message and made emoji and text a string

earnest phoenix
#

My bot is saying 1+1=3 but the math code should make the bot do 1+1=2
@earnest phoenix help

digital ibex
#

code?

earnest phoenix
#

Code= do maths

digital ibex
#

bad bot

earnest phoenix
#

Why

boreal iron
#

agreed

earnest phoenix
#

😦

digital ibex
#

because like ever other bot has all countries and some have countries and states for free lol

boreal iron
#

Wrong place to discuss, if u have an issue post the code in here or head to #general

digital ibex
#

and u have to pay for more shit lmfao

#

or to remove an ad

earnest phoenix
#

because like ever other bot has all countries and some have countries and states for free lol
@digital ibex lol but I want to get money

quartz kindle
#

@wicked pivot remove the this from axios

digital ibex
#

lmao

#

tim, he meant what is he meant to put there

earnest phoenix
#

That’s useless without money

digital ibex
#

lmfaooo

halcyon pecan
#

@earnest phoenix that's bad bot

#

Ngl

earnest phoenix
#

😦

#

lol

#

Why

indigo flax
#

@earnest phoenix nobody needs a covid19 bot..

halcyon pecan
#

Do a CoRonny Bot

earnest phoenix
#

@earnest phoenix nobody needs a covid19 bot..
@indigo flax if they do

indigo flax
#

theres already a verified one

#

that can do countries

#

and states

earnest phoenix
#

Do a CoRonny Bot
@halcyon pecan what is Coronny bot

quartz kindle
#

@earnest phoenix if you're making a bot for money, you're gonna have a bad time lmao, there are plenty of bots that do the same thing for free

halcyon pecan
#

CoRonny is Corona

acoustic veldt
#

Can someone tell the code for a function which tells how much hours , minutes and seconds remain for a specific time to come @quartz kindle

halcyon pecan
#

Lmao

earnest phoenix
#

@earnest phoenix if you're making a bot for money, you're gonna have a bad time lmao, there are plenty of bots that do the same thing for free
@quartz kindle lol no I make them for fun nothing alse

indigo flax
#

making money from bots arent worth it

#

my bot is in 1,000 servers

#

ive only made

#

$20-50

earnest phoenix
#

making money from bots arent worth it
@indigo flax lol

halcyon pecan
#

Pog

quartz kindle
#

thats pretty good already

boreal iron
indigo flax
#

nah

carmine magnet
#

SolDeveloper#7124 is a kid want make money with his bot to buy vbucks

earnest phoenix
#

$20-50
@indigo flax isn’t that a good

indigo flax
#

its $1.99 a month

#

for premium

digital ibex
#

hey

earnest phoenix
#

SolDeveloper#7124 is a kid want make money with his bot to buy vbucks
@carmine magnet lol no

digital ibex
#

i want to make money from my bot too

#

why else do u think im doing it

earnest phoenix
#

I hate Fortnite

digital ibex
#

im broke as shit

quartz kindle
#

@boreal iron hes using py lol

acoustic veldt
boreal iron
#

oh...

indigo flax
#
boreal iron
#

how can I know if you didn't mention?

earnest phoenix
#

I hate Fortnite

quartz kindle
#

@acoustic veldt google how to work with timestamps and how to do math with dates in python

indigo flax
#

@digital ibex anyways can u help me

quartz kindle
#

its not hard, just requires a bit of logic

earnest phoenix
#

SolDeveloper#7124 is a kid want make money with his bot to buy vbucks
@carmine magnet lol I think it’s you because I hate Fortnite

digital ibex
#

?

#

what do u need help with

carmine magnet
#

I make bots with heart, not for money

boreal iron
#

I guess with love u mean, lmao

indigo flax
#

@digital ibex 265156286406983680-772127376528113704

digital ibex
#

im like the total opposite

indigo flax
#

it doesnt do

#
  • @indigo flax
digital ibex
#

show ur code

indigo flax
#

ok

earnest phoenix
#

I make bots with heart, not for money
@carmine magnet I said I make bot for fun no thing alse but my Covid bot has api that’s host me money for hosting

indigo flax
#

wait

carmine magnet
#

You can have cheap vps

earnest phoenix
#

cheap VPS =

#

||sh&:)||

digital ibex
#

nah

#

i mean depends

indigo flax
#

i own a host company :)

#

so i get free hosting

#

i use my own host

#

to host my bots

#

big brain

carmine magnet
#

I have a really good vps for 3,95€/month its a really good offer for all the performances given

indigo flax
#

but we still pay $100 a month to keep the host money sooooooooo

earnest phoenix
#

best cheap vps is ||your own PC biggestbrain ||

quartz kindle
#

90% of all hosting services out there are basically resellers

indigo flax
#

we use ptoerdactyl

#

so nope

#

not reseller

halcyon pecan
#

@carmine magnet what's the hosting name? And with Linux?

quartz kindle
#

rent a big host, split it into smaller hosts, rent them out

carmine magnet
obtuse jolt
#

Yeah sounds about right

earnest phoenix
digital ibex
#

lol

indigo flax
obtuse jolt
quartz kindle
#

@carmine magnet thats pretty good

earnest phoenix
#

Lmao

boreal iron
#

providing more and more VM to anyone without any knowledge, flooding the net with more and more bot server... thanks

digital ibex
#

so small problem, js const obj = { user: '', timestamp: 0, content: '' }; for (const message of messages) { obj.user = message.member.user.id; obj.timestamp = message.timestamp; obj.content = message.content; } when i log obj it just logs the first message

#

any ideas?

obtuse jolt
#

I used to own a hosting business too

quartz kindle
#

@digital ibex you're creating 1 object

carmine magnet
#

@halcyon pecan its a french company called inovaperf, you can install every os you want on ur vps

digital ibex
#

yeah but shouldn't it be making loads?

quartz kindle
#

then on every iteration of the loop, you are replacing the object's properties

#

lmao

halcyon pecan
#

@carmine magnet that's hot let me check that out

digital ibex
#

or should i make obj an array of objects 💀

#

im confused

pale vessel
#

yes

quartz kindle
#

array of objects

digital ibex
#

kk

#

how would i make it change the object?

#

like

indigo flax
#

@digital ibex 2020-10-31T16:05:06.505481+00:00 app[worker.1]: ReferenceError: message is not defined 2020-10-31T16:05:06.505501+00:00 app[worker.1]: at /app/app.js:81:66 2020-10-31T16:05:06.505502+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5) 2020-10-31T16:05:16.830590+00:00 app[worker.1]: ReferenceError: message is not defined 2020-10-31T16:05:16.830620+00:00 app[worker.1]: at /app/app.js:81:66 2020-10-31T16:05:16.830622+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)

digital ibex
#

obj.user[thishere] = message.member.user.id;

sudden geyser
#

Conspiracy theory: GNU stands for GNU's Not Unix. If this is the case, then the meaning of GNU's Not Unix should stand for GNU's Not Unix Not Unix. With this recursive pattern, how could GNU stand for GNU's Not Unix 🤔

digital ibex
#

change message to msg @indigo flax

indigo flax
#

ok

quick ridge
digital ibex
#

any ideas tim?

pale vessel
#

you can usejs const objects = []; for (const foo of bar) objects.push({ name: foo.name });

indigo flax
#
2020-10-31T16:07:26.309336+00:00 app[worker.1]:     at /app/app.js:81:77
2020-10-31T16:07:26.309358+00:00 app[worker.1]:     at processTicksAndRejections (internal/process/task_queues.js:97:5)```
digital ibex
#

oh yeah ty

indigo flax
#

officiallylost

#
2020-10-31T16:07:26.309336+00:00 app[worker.1]:     at /app/app.js:81:77
2020-10-31T16:07:26.309358+00:00 app[worker.1]:     at processTicksAndRejections (internal/process/task_queues.js:97:5)```
digital ibex
#

show ur code

obtuse jolt
#

If you aren’t using JSON to communicate between nodejs files and you even coding

indigo flax
#
    function translateFunction(lang, string, flag){
      if(string == "" || string == null || string == undefined) return msg.channel.createMessage("Nothing to translate!");
      translate(string, { to: lang }).then((res)=>{
        if (res.text.length > 200) {
          return msg.channel.createMessage(`${flag}\n${res.text}`);
        }
        msg.channel.createMessage({ embed: {
          color: 0xFFFFFF, description: `${flag} ${res.text} - ${msg.member.mention}`
        }});
      }).catch(err => { console.error(err) });
    }```
@digital ibex
quartz kindle
#

@quick ridge attachment:attachment, name: "attachment://spotify_idhere.png"

digital ibex
#

idk console.log(msg.member)

#

wait no

#

change msg.member to msg.author

#

it might work idk

quick ridge
indigo flax
#

hm

digital ibex
#

im guessing its working?

indigo flax
#

yes

#

ty

digital ibex
#

np

quartz kindle
#

@quick ridge then do attachment:buffer

#

or files:[attachment]

quick ridge
#

its sending like this

quartz kindle
#

yes

#

if you want it inside them embed, then you have to .setImage("attachment://file name here")

digital ibex
#

finallyyy

#

ty flaz and tim

quick ridge
earnest phoenix
#

Guys I need help. I wrote a message that will say how many users there are: message.channel.send(bot.users.cache.size) and it doesn't work, all it shows is 17 users when there are over 54 guilds and I remember there are 1200 users. I turned intents on, but nothing happened. Please help.

acoustic veldt
#

File "bot.py", line 212
elif now.hour >= 18 and now <= 19:30:

#

@quartz kindle it gives this error

#
@client.command()
async def current_event(ctx):
    now = datetime.now(IST)
    if now.hour >= 15 and now.hour <= 16:
        await ctx.send(f'Current event is Compete With us')
    elif now.hour >= 16 and now.hour <= 17:
        await ctx.send(f'Current Event is Pictionary')
    elif now.hour >= 17 and now.hour <= 18:
        await ctx.send(f'Current Event is The GodLike Radio Show')
    elif now.hour >= 18 and now <= 19:30:
        await ctx.send(f'Current Event is Team Up With GodLike')
    elif now >= 19:30 and now <= 21:00:
        await ctx.send(f'Current Event is Talent Show')
    elif now.hour >= 21 and now <= 21:30:
        await ctx.send(f'Current Event is Poetic Night')
    elif now >= 21:30 and now <= 10:15:
        await ctx.send(f'Current Event is Talkshow With Team GodLike') 
#

this is my code

quartz kindle
#

you cant use 19:30

#

you need to either check if hour equals 19 AND minute > 30

#

or convert the date to a timestamp

#

19:30 is not a valid mathematical number

acoustic veldt
#

then what do I type

quartz kindle
#

i told you

#

check if hour equals 19 and minute is bigger than 30

acoustic veldt
#

now.hour >= 18 and now.hour == 19 and now.minute <= 30

#

this ?

quartz kindle
#

yes

quick ridge
#

hey tim what can i do bro

quartz kindle
#

but that's not making much sense because yo have conflicting times there

quick ridge
#

its not sending the photo

quartz kindle
#

@quick ridge what is the problem

quick ridge
quartz kindle
#

you removed the file

quick ridge
acoustic veldt
#

now.hour >= 18 and now.hour == 19 and now.minute <= 30
this will not work u mean ?

quick ridge
#

i cant do anything its module

pale vessel
quartz kindle
#

if its equal do 19, then it is automatically bigger than 18, so that bigger than 18 is useless

mighty atlas
#

@quick ridge you should only give your file a name, not a path in the MessageAttachment constructor (i think)

quartz kindle
#

@quick ridge to send attachments in embeds you need both the file and the embed

#

before you had the file

#

you just had to add it to the embed

#

but you removed the file

mighty atlas
#

and then attach it with the attachFiles method

quartz kindle
#

you dont even need to use attachFiles

mighty atlas
#

oh i didnt know that-

quick ridge
quartz kindle
#

which is using a raw embed instead of the embed builder

quick ridge
quartz kindle
#

@quick ridge you are mixing things up

#

doing half one thing half another thing

#

what do you want t use? the MessageEmbed or a {embed:{}}?

quick ridge
#

its just a module i do not anything

quartz kindle
#

you are lol

quick ridge
#

module its doing this photo i don't know canvas ¯_(ツ)_/¯

quartz kindle
#

the problem is not the module

#

is what you are doing

#

do you want to use MessageEmbed or {embed:{},files:[]}?

#

both will work

quick ridge
#

I want to embed the picture I created with canvas.

quartz kindle
#

you're not answering my question

quick ridge
#

MessageEmbed its

#

good for me

quartz kindle
#

then use .attachFiles([attachment])

acoustic veldt
#

@quartz kindle so how do I put it like its between 18 to 19 30

#

whats the exact statement

quartz kindle
#

its just simple math

boreal iron
#

Your statements doesn't make sense anyway

quick ridge
boreal iron
#
        await ctx.send(f'Current event is Compete With us')
    elif now.hour >= 16 and now.hour <= 17:
        await ctx.send(f'Current Event is Pictionary')```
quick ridge
#

its sending like this now

quartz kindle
#

if hour == 18 or (hour == 19 and minute < 30)

boreal iron
#

did u ask yourself what happens if it's for example 16 o'clock

quartz kindle
#

idk how and/or works in py

#

@quick ridge with what code

acoustic veldt
#

@boreal iron I was going with 24 hour clock

quick ridge
quartz kindle
#

@quick ridge dont remove setIMage

#

i told you you NEED BOTH

#

also, you have .pngg

boreal iron
#

I'm gonna try to explain it again...

if now.hour >= 15 and now.hour <= 16:
elif now.hour >= 16 and now.hour <= 17:

Both statements check if hour == 16 (and if < and >)

quick ridge
#

ty you soo much mate ❤️

quartz kindle
#

@acoustic veldt what he means is that if the time is 16:00, then both lines are true

boreal iron
#

<= means smaller and/or equal

quick ridge
#

sorry that i am bad my english is not very good

quartz kindle
#

16 is bigger than 15, and equal to 16, yes, but 16 is also equal to 16 and smaller than 17

boreal iron
#

same happens for the next hours, too looking at your elseif statements

#

@quartz kindle Don't u get exhausted by dealing with this kind of issues "every" day?

indigo flax
#

help

#

my status isnt working

#

it always worked

#

bot.editStatus("online", {
name: !t help | Watching ${bot.users.size} users.,
type: 0
})
})

#
    name: `!t help | Watching ${bot.users.size} users.`,
    type: 0
  })
})```
umbral zealot
#

how is it not working

quartz kindle
#

@boreal iron surprisingly not really

indigo flax
#

its not showing the status

#

it always showed it

earnest phoenix
#

okay nodejs v15 is lit

#

AbortController is finally a thing

quartz kindle
#

and v14 is finally lts

#

time to upgrade

acoustic veldt
#

2020-10-31T16:42:39.817027+00:00 app[worker.1]: from pytz import timezone
2020-10-31T16:42:39.817044+00:00 app[worker.1]: ModuleNotFoundError: No module named 'pytz'

#

@quartz kindle it is not importing modules

quartz kindle
#

you need to install it using pip

acoustic veldt
#

I did

quartz kindle
#

where are you hosting?

earnest phoenix
#

hey

#

can someone help me

#

module.exports = {
    name: 'suggest',
    category: 'Utility',
    description: 'does suggestions',
    usage: '!suggest',
    run: async (client, message, args, member) => {
    let Suggestion = args.join(" ");
    if(Suggestion.length > 2048) return message.reply("Suggestion to big.")
    let embed = new MessageEmbed()
    .setColor('BLUE')
    .setAuthor(`${member.user.tag}`, message.guild.iconURL({type: "png", dynamic: true}))
    .setDescription(Suggestion)
    .setTimestamp()
    let Suggestionschannel = message.guild.channels.cache.get('772122849669808178') 
    Suggestionschannel.send(embed).then(message => {
        message.react('👍'),
        message.react('👎')
    })
    }
}
#

it says user cannot read property 'user' of undefined

#

idk what i did wrong

pale vessel
#

define member

earnest phoenix
#

its working without the ${member.user.tag}

pale vessel
#

define member

earnest phoenix
#

okay

halcyon pecan
#

Do what flaze told ya

pale vessel
#

could be message.member

#

who knows

earnest phoenix
#

thx

#

how could this happen to me lol

#

i just put message.member.user.tag

wicked pivot
#

how to make the list of guilds where the bot has permission to send a message

clear elbow
#

how can i fix that ?

stable eagle
#

@wicked pivot by filtering the guild array

wicked pivot
#

@stable eagle that I know well but to proceed? js console.log(bot.guilds.filter(r => r.members))

stable eagle
#

bot.guilds.cache.filter(r => !r.me.hasPermission('SEND_MESSAGES'))

acoustic veldt
#

@quartz kindle heroku

wicked pivot
#

@stable eagle thx

hollow sedge
#

@acoustic veldt do you have a requirements.txt file?

acoustic veldt
#

yes I added that to it and now it worked

#

@hollow sedge but I have a new error now

#

it says that module date time does not have any attribute as now

wicked pivot
#

how to locate a certain information example: "hi, how are you?" retrieve what has before the ","

clear elbow
#

how to make the bot to remove a specific role when a specific reaction removed ?

acoustic veldt
#

@clear elbow .py ?

clear elbow
#

yes

#

i try of it but i get an error

acoustic veldt
clear elbow
#

yes

#

i have python 3.8 and the last discord py wtih pynacl

slender thistle
#

Remove from a member or a server

clear elbow
#

this is my code

#

i want to remove the role of the member that takes the reaction back

slender thistle
#

how to locate a certain information example: "hi, how are you?" retrieve what has before the ","
@wicked pivot string.indexOf(",")

#

Python: string.index(",")

hollow sedge
#

@acoustic veldt that's because it's datetime.datetime.now()

acoustic veldt
#

oh okay

wicked pivot
#

@slender thistle js

acoustic veldt
#

@hollow sedge and also

slender thistle
#

payload.member??

#

That's a thing?

acoustic veldt
#

can you tell how to make a function where the user can make its on embed

hollow sedge
#

library developer

slender thistle
#

I didn't code discord.py so your sarcasm is irrelevant

indigo flax
#

how bot's presence isnt working

hollow sedge
#

@slender thistle it's a joke but ok

indigo flax
#

it always work

acoustic veldt
#

I know how to add message and title for the embed , but I dont know how can I set it to a channel

#

@hollow sedge

#

can you tell how to make a function where the user can make its on embed

hollow sedge
#

@acoustic veldt yes one sec

slender thistle
#

You mean users sending their own customizable embeds?

hollow sedge
acoustic veldt
#

@slender thistle yes

slender thistle
#

You could possibly use a separator instead of relying on command arguments

acoustic veldt
#

yes I took

@client.command()
async def announce(ctx, title : str, message : str)
``` @hollow sedge
hollow sedge
#

It's already a str lol

slender thistle
#

and force users to use the command like .embed title="etc etc" | description="qweqwe"

hollow sedge
#

That should work though

violet lark
#

I neet help.

slender thistle
#

with

acoustic veldt
hollow sedge
#

@acoustic veldt yes so just use the variables title and message and create your embed with them

slender thistle
violet lark
#

making the bot only with out me having to neet the script open.

slender thistle
#

and I can literally write a script to handle that no problem

acoustic veldt
#

yeah that I did

#

title = f'{title}'

hollow sedge
#

So what's the problem?

acoustic veldt
#

like this right ?

hollow sedge
#

Well no need for the f-string

slender thistle
#

No need for the f-string

acoustic veldt
#

okay I will change taht

#

and the problem is

slender thistle
#

and definitely no need for title = ... if you don't modify it

acoustic veldt
#

I want to take the input as channel

#

and send it to that channel

#

if it is possible

slender thistle
#

channel: discord.TextChannel in command arguments

hollow sedge
#

You can just use ctx.channel

#

Oh wait you want to send it to a specific channel

earnest phoenix
#

hi anyone know why this doesnt giv the corect count ? message.guild.users.cache.filter(m => !m.user.bot).size

hollow sedge
#

Yeah just use what @slender thistle said

acoustic veldt
#

@hollow sedge yeah

slender thistle
#

hi anyone know why this doesnt giv the corect count ? message.guild.users.cache.filter(m => !m.user.bot).size
@earnest phoenix How incorrect is it?

acoustic veldt
#

okok

earnest phoenix
#

totaly not corect

acoustic veldt
#

then I type
ctx.channel.send(embed=embed)

#

??

earnest phoenix
#

iv 10 users in server and it says there are only 2

hollow sedge
#

No

#

You type

slender thistle
#

m.bot

hollow sedge
#

channel.send(embed=embed)

slender thistle
#

not m.user.bot 🤔

acoustic veldt
#

okok

slender thistle
#

actually wtf is that

hollow sedge
#

Because otherwise it will just send it to the channel that the command came from

earnest phoenix
#

yh srry

#

had members in there

acoustic veldt
#

IDK but I always forget a "," after title and description 😅

earnest phoenix
#

was messing a bit

slender thistle
#

Oh, so it's guild.members in your code?

earnest phoenix
#

message.guild.members.cache.filter(m => !m.user.bot).size

hollow sedge
#

@acoustic veldt those are just arguments lol

earnest phoenix
#

yh this doesnt work

hollow sedge
#

You always need a , to separate them

earnest phoenix
#

it givs i hve 2 users in my server

slender thistle
#

Try outputting size of the member cache and compare it

#

Are you sure you have the guild_members intent enabled?

earnest phoenix
#

i only get my (message author) and bot info

acoustic veldt
#
@client.command()
async def announce(ctx, title : str, message : str, channel : discord.TextChannel):
    embed = discord.Embed(
        title = '{title}',
        description = '{message}',
        color = discord.Color.orange()
    )

    channel.send(embed=embed)```
earnest phoenix
#

it only count me and the bot

acoustic veldt
#

final code ?

hollow sedge
#

@acoustic veldt no remove the brackets around the variables

#

And the ""

slender thistle
#

title = title

#

description = message

hollow sedge
#

The variable is already holding a string

acoustic veldt
#

oh okay

slender thistle
#

(Also PEP8 please)

acoustic veldt
#

anything else ?

hollow sedge
#

No it looks good

#

Wait

#

You need to await the channel.send

#

@acoustic veldt

acoustic veldt
#

yeah I realised that and changed it

slender thistle
#

Can we have a sync version of d.py just for shits and giggles

hollow sedge
#

It shall be done

earnest phoenix
#

does this look right at all ?

sql = "DELETE FROM BlacklistedUser_IDs WHERE User_IDs = VALUES(?);"
    cursor.execute(sql, (member.id))```
slender thistle
#

Is your column named User_IDs?

earnest phoenix
#

yes

slender thistle
#

Then it should work unless your package requires you to also commit the changes

earnest phoenix
#

i also have db.commit()

#

but it wont work,

hollow sedge
#

The discord servers on the left 😆

earnest phoenix
#

yes yes

#

top tier

acoustic veldt
#

Is there a way to tell how much time is left for a specific time to come (in discord.py)

#

like a countdown thing

hollow sedge
#

Use the datetime module

acoustic veldt
#

I have it imported GWnekomakiAngeryBOYE

hollow sedge
#

You can subtract the later time by now

slender thistle
#

datetime object +- timedelta object = new datetime object

hollow sedge
#

+-?

acoustic veldt
#

lol

slender thistle
#

either + or -, whichever you need

green kestrel
hollow sedge
#

Oh

acoustic veldt
#

lol

slender thistle
#
from datetime import datetime, timedelta
>>> datetime.now() * timedelta(minutes=5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'datetime.datetime' and 'datetime.timedelta'
>>> datetime.now() / timedelta(minutes=5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'datetime.datetime' and 'datetime.timedelta'
>>> datetime.now() - timedelta(minutes=5)
datetime.datetime(2020, 11, 1, 0, 7, 0, 397258)
>>> datetime.now() + timedelta(minutes=5)
datetime.datetime(2020, 11, 1, 0, 17, 2, 250035)
hollow sedge
#

Uhh what

#

Are you saying that you can't multiply or divide time?

slender thistle
#

not with the objects directly at least

#

Use timestamps for that catshrug

acoustic veldt
#
@Client.command()
async def current_event(ctx):
    now = datetime.datetime.now(IST)
    if now.hour >= 15 and now.hour <= 16:
        await ctx.send(f'Current event is Compete With us')
    elif now.hour >= 16 and now.hour <= 17:
        await ctx.send(f'Current Event is Pictionary')
    elif now.hour >= 17 and now.hour <= 18:
        await ctx.send(f'Current Event is The GodLike Radio Show')
    elif now.hour >= 18 and (now.hour >= 19 and now.minute <= 30):
        await ctx.send(f'Current Event is Team Up With GodLike')
    elif (now.hour == 19 and now.minute <= 30) and now.hour <= 21:
        await ctx.send(f'Current Event is Talent Show')
    elif now.hour >= 21 and now.minute <= 30:
        await ctx.send(f'Current Event is Poetic Night')
    elif (now.hour == 21 and now.minute <= 30) and now.hour <= 10:
        await ctx.send(f'Current Event is Talkshow With Team GodLike')```
#

whats wrong in this

slender thistle
#

what's IST?

acoustic veldt
#

its Indian standard time

#

I used it to define time

#
IST = pytz.timezone('Asia/Kolkata') 
IST.zone```
#

I am an Indian 😅

slender thistle
#

oh fuck off Python, where's my country's timezone

acoustic veldt
#

lawl

hollow sedge
#

@acoustic veldt what's the error?

acoustic veldt
#

no error

#

it just doesnt work

#

and it also spoils the whole code without letting anything else also not work

hollow sedge
#

@Client.command

#

Is this capitalized in your variable declaration?

#

Is client capitalized

acoustic veldt
#

no it was capitalized when i wrote it on discord

#

its normal in my VS code

hollow sedge
#

So what you're saying is <prefix> current_time

#

Does not work?

acoustic veldt
#

when I type _current_event

#

it doesnt show anything

#

and when I check heroku logs

#

it doesnt show anything too

hollow sedge
#

Try running it locally first

#

Also you don't need to make normal strings, f-strings

acoustic veldt
#

I treid

#

it doesnt show anything in the terminal too

hollow sedge
#

That doesn't make sense

#

Your bot must be starting improperly

#

Could you send your file where you are starting your bot?

acoustic veldt
#

you mean the procfile ?

hollow sedge
#

No I mean bot.py or main.py

acoustic veldt
#

ok I will send file without the TOKEN

hollow sedge
#

Ok sure

#

That should be an env variable anyway

acoustic veldt
hollow sedge
#

bro

#

you sent it with the token

#

reset your token

balmy knoll
#

In discord.js, how can I check that a user entering a server has not already entered before?

quartz kindle
#

because NaN is not a number

#

@balmy knoll the only way to do that is if you save in a database every user who enters it

acoustic veldt
#

Ok I regenrated token

quartz kindle
#

np :)

hollow sedge
#

@acoustic veldt ok good im still looking for the error rn

quartz kindle
#

well, NaN means "Not a Number", so yeah, its not a valid number

#

xD

wicked pivot
#
bot.channels.cache.filter(r => r.me.hasPermission('SEND_MESSAGES')).size```

```(node:26068) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hasPermission' of undefined```
quartz kindle
#

nice

#

still, nothing can be known or done from that information alone

hollow sedge
#

@acoustic veldt found the problem

quartz kindle
#

you're trying to use something that requires a number but is not getting a number, likely because of trying to do math with non numbers, or having undefined or null vaiables

hollow sedge
#

you have an on_message event and you are not processing commands after running everything there

quartz kindle
#

but you have to find it out yourself, there is no indicator whatsoever on where the problem may be from those logs alone

hollow sedge
#

@acoustic veldt

quartz kindle
#

maybe if you post your code, i can try to find it

acoustic veldt
#

??

#

didnt get it

hollow sedge
#

@acoustic veldt you need to add client.process_commands(message) at the end of the on_message event

#

because you are overwriting the default event

acoustic veldt
#

at what line

hollow sedge
#

at the bottom of on_message

quartz kindle
#

@wicked pivot channels have no .me

hollow sedge
#

im not going to tell you exactly which line lol

wicked pivot
#

r.hasPermission('SEND_MESSAGES') ?

acoustic veldt
#

@hollow sedge can you tell the exact line of code

hollow sedge
#

@hollow sedge that's the most asshole move ever
@hoary hill if i was an asshole, i wouldnt have helped this guy as much as i did

acoustic veldt
#

if your enterpretuer has that

#

function

hollow sedge
#

hold on

#

ill send a better picture

quartz kindle
#

@wicked pivot channels dont have permissions

slender thistle
#

@hollow sedge aWAIt IT

#

295014158771159040 that's the most asshole move ever
@hoary hill we are here to help people, not do everything for them

quartz kindle
#

@hoary hill i already told you what to do

slender thistle
#

... and you say they're an asshole?

#

but you have to find it out yourself, there is no indicator whatsoever on where the problem may be from those logs alone
@quartz kindle
maybe if you post your code, i can try to find it
@quartz kindle

quartz kindle
#

LOL

hollow sedge
#

dude why are you even in this channel then

quartz kindle
#

lmao

slender thistle
#

Oh good luck getting help with those

quartz kindle
#

nobody here uses discord bot maker

slender thistle
#

You might wanna ask in the DBM server instead

quartz kindle
#

go look for help elsewhere

slender thistle
#

No one who is actually good at using it

quartz kindle
#

no one who is good at anything actually uses it

hollow sedge
#

DBM is harder than python or js

#

it requires a lot of work

#

🤦

slender thistle
#

What does DBM syntax look like

#

But do you have custom code in your bot

#

Or really, access to the part of the code where you think the error occurs

quartz kindle
#

well, the least you can do is show us something, like what changes you made

#

otherwise there is nothing we can do to help

#

do you have any custom code in some event listener?

#

like on message, or on presence update

#

keep removing things until it stops

#

then add them back one by one

slender thistle
#

inb4 removes everything and it still occurs

#

(forgets to save after all changes ftw)

quartz kindle
#

not as hard as trying to guess whats going on for someone else who provided 0 information

hollow sedge
#

wth

#

your bot has 125 commands?

quartz kindle
#

as in, no code, no scripts, no commands, no events

#

and logs with no stack trace

slender thistle
#

I mean

#

If it can help

#

Why not

rain moss
#

guys can i ask a question?

slender thistle
#

P.S. you already did

sudden geyser
#

Ask away

slender thistle
#

P.P.S. just ask your question instead of asking if you can ask one

quartz kindle
#

can you disable these plugins instead of disabling your commands?

#

and see if it stops

slender thistle
#

P.P.P.S. it's easier and saves time for everyone

quartz kindle
#

do these plugins have code in them that could be edited?

slender thistle
#

Abolish bot makers kek

quartz kindle
#

can you show these?

#

sure

#

how many guilds is your bot in?

copper onyx
#

:0

#

:

quartz kindle
#

does dbm have any way to configure events or intents?

#

do you know if presenceUpdates are being received and processed?

#

do you have presences intent enabled in your bot's dev portal?

#

do you have some kind of loop or some function that does something a lot of times at once, or to a lot of people at once?

#

do you have stuff that runs as soon as the bot logs in?

earnest phoenix
#

does anybody here use pm2 or nodemon?

quartz kindle
#

i use pm2

crystal wigeon
#

hey

#

anyone having issues with discord-player?

#

there seems to be compatibality issues

#

i keep getting errors from "Player" token '??' is missing

earnest phoenix
#

@quartz kindle i tried using both pm2 and nodemon and both cause my bot to not display a status that i set. when i just start it regularly with node . , it works perfectly

#

do you have the same issues?

quartz kindle
#

nope

crystal wigeon
#

have you guys tried forever?

#

to keep your app running as a service

hollow sedge
#

i think that's the point

crystal wigeon
#

anyways. any issues with discord-player?

#

cant seem to get it to work

hollow sedge
#

what's the point of discord-player lol

#

like there are already so many music bots

quartz kindle
#

@crystal wigeon whats your node.js version?

crystal wigeon
#

12.16.3

#

@quartz kindle

#

and ytdl says every yt url i provide is not available >.>

#

but if i directly paste the url in ytdl it works but if i send it as args it doesnt work like wtf??

#

if i pass the same link to ytdl(url, {filter: "audioOnly" })

#

it works

#

like wtf?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

me too

gloomy zenith
#

lmao

crystal wigeon
#

yo

#

everyone just ignored me

#

;-;

earnest phoenix
#

i remade microsoft.extensions.dependencyinjection in typescript because i love oop KEKW

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

hmmmm

#

i think github has / had one

#

give me a second

tired panther
#
let stat = client.guilds.cache.get("734707332163829780").members.fetch("735147814878969968").presence.status
``` this is giving the error
earnest phoenix
#

yeah i can't find it

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

fetch is a promise

#

@sage bobcat try solving old CTFs

tired panther
#

how to resolve it?

earnest phoenix
#

that's what i used to do during quarantine lol

sage bobcat
#

One message removed from a suspended account.

wintry elk
#

hello

earnest phoenix
#

take a guess @tired panther

wintry elk
#

i want help in discord.js

earnest phoenix
#

capture the flag @sage bobcat

sage bobcat
#

One message removed from a suspended account.

tired panther
#

message.client.users.resolve(mystatus);

earnest phoenix
#

no no

#
wintry elk
#

how i can make guess game?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

literally just await it lol @tired panther

#

there's a ton of CTFs like this, browse around for some

wintry elk
#

i want make guess game like dank memer how?

tired panther
#

literally just await it lol @tired panther
@earnest phoenix does not work

earnest phoenix
#

what's your code

cunning timber
#

hey I'm fairly new to discord bot programming, I've wrote a bot with the JDA API and want to host it now. Can anybody suggest me a way or a service to host it?

earnest phoenix
#

and what doesn't work

tired panther
#
    setInterval(async function() { 
        let status = await client.guilds.cache.get("734707332163829780").members.fetch("735147814878969968")
 let chanstat = client.channels.cache.get("771757921490042910");
            let announce = client.channels.cache.get("738786433766260869");
        if(status.presence.status === "offline"){
           
            if(chanstat.name === "🟢 Bot is online !"){
               console.log("alpha Bot is offline")
               chanstat.setName("🔴 Bot is offline !");
               announce.send("🔴**The Bot seems to be offline. It will not respond due to outage.**")
                  
            }  
        }
        if(status.presence.status === "online"){
           
            if(chanstat.name === "🔴 Bot is offline !"){
               console.log("alpha Bot is online")
               chanstat.setName("🟢 Bot is online !");
               announce.send("🟢**The Bot is back online, enjoy it!**")
            }  
        }
    }, 600000);
#

@earnest phoenix

quartz kindle
#

what is the error

#

also, you forgot {user:id,withPresences:true}

tired nimbus
#

I set my owner as

let own = await bot.users.cache.get("372511780494114818");

but when I try to send a message, like

own.send("hello")

it returns that own is undefined. This has only recently happened. This didnt happen before

restive furnace
#

<Collection>#get() is synchronous

#

<Client>#users#fetch() is asynchronous

#

you have to learn the difference

tired nimbus
#

yes I know that the user is not cached but why did it work before

tardy hornet
#

i have a say command,

#

and i want that if they want to ping everyone with it it wont let them

#

so

#

if(args.slice(1).join(' ').includes('@everyone')) return message.channel.send('haha nice try mate.')

#

did i did it right?

quick ridge
#

hello i want to make spotify command with photo, can you suggest a module that is easy

quartz kindle
#

@tired nimbus before, discord used to send online users at login, so your bot would always start with a certain amount of cached users

#

they recently changed it so that they dont do this by default anymore, only if you enable the "guild members" intent in your developer portal

#

so without enabling it, your bot will start with only itself and voice channel users cached

faint prism
#

hello i want to make spotify command with photo, can you suggest a module that is easy
@quick ridge programming language?

quick ridge
#

javascript @faint prism

tired nimbus
#

oh I see

faint prism
#

since it is relatively up to date

tardy hornet
#

i have a say command,
and i want that if they want to ping everyone with it it wont let them
so
if(args.slice(1).join(' ').includes('@everyone')) return message.channel.send('haha nice try mate.')
did i did it right?

haughty mirage
#

@tardy hornet I assume you have tested it?

#

💩

tardy hornet
#

i still have no

#

t

#

i dont want to run my bot, so people that use him wont get the same message twice

#

@haughty mirage

#

but how its looks like

#

i assume it should work

haughty mirage
#

Bruh, go make another bot to test with

#

Beta version or something

quick ridge
#

i was using canvacord @faint prism

faint prism
#

or use a debug prefix

quick ridge
#

i think your module is not for my want

karmic compass
#
const life = Java.type("java.awt.LifeForce")

function bringBackToLife(orgNum) {
  if(!orgNum) throw "Missing organism number to bring back to life"
  life.org.regen(orgNum).then(output => {
    if(life.dead(output)) throw "Dead organism"
  }
})

const myFuckingCat = Java.type("java.awt.LifeForce.organism.orgNum.00316778")

bringBackToLife(myFuckingCat)
``` why no work
sudden geyser
#

It's your code. You tell us.

karmic compass
#

uh

sudden geyser
#

What went wrong. Did you get an error? Did you get an unexpected result?

karmic compass
#

const life = Java.type("java.awt.LifeForce")

#

ReferenceError: Java is not defined

#

if you haven't already noticed by the way

#

i'm Java.typeing the literal lifeforce

sudden geyser
#

Well, you're writing JavaScript, so I assume you're using some package to communicate between Java and JavaScript. What is Java supposed to represent and what package does it come from?

karmic compass
#

oh uh

#

i was using another thing

#

nvm i'm going to ask in that discord instead

#

because Java.type is exlusive to that part

whole knot
#

Hey, got a quick question: Since yesterday my music bot does not work anymore. Actually 3 bots are affected. If I try to play a song via bot all I get is:
ERROR: Unable to extract JS player URL; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. - I thought it would be an outdated req. problem so I updated everything, no effect. I looked up on the internet and found a thread which is kind of fresh. After reading this I recognized that it is closed so the error seems to be fixed but I still get the error on every video. Is someone familiar with this? I use Python btw.

quartz kindle
#

is it related to this?

whole knot
#

Yes, this was what I read

#

But sometimes can be replaced with "every time" for my side

tulip ledge
#

@whole knot pretty sure that ytdl got "copyright striked"

whole knot
#

Yes, they got removed from GitHub but it should still be usable 🤔

#

Or am I wrong?

quartz kindle
#

seems to be youtube testing new protections for copyrighted music

whole knot
#

Playing https://www.youtube.com/watch?list=PLexkHoTXo4UqctcWPvP246bV-Uhh7MNkQ gives out songs but not the wanted one 😅

#

I thought this would be a copyright problem too as I also implemented that the bot does not play these kind of songs but even not known songs run into the error

#

This was the only "play" command that worked and put some playlist in the songs

earnest phoenix
#

how can I get the number of members in a role.

#

Hey, every npm package im installing is installed to AppData/Roaming/npm/node_modules/ instead of <currentDir>/node_modules how can I fix it? I know that only global modules should be installed into AppData/Roaming/npm/node_modules/ and not any module, so why does it happen?

quartz kindle
#

@earnest phoenix the only way to do that is to use the fetchAllMembers option in your library

earnest phoenix
#

How can I integrate it into this code

message.guild.members.cache.filter
 (member => member.roles.cache.find(r => r.name === 'Mekan Booster'))
 .map(member => member.user.tag)
quartz kindle
#

its a client option

#

you set it where you create your client

#

new Discord.Client({fetchAllMembers:true})

#

but after the recent changes made by discord, you need to enable the server members intent in your developer portal for this to work

earnest phoenix
#

i did it

#

previously

whole knot
#

Have you imported them?

#

Something like:

intents = discord.Intents.default()
intents.members = True

class YourName(XXXX):

    def __init__(self):
        super().__init__(command_prefix=determine_prefix, owner_id=parser.getint('DISCORD', 'owner-id'),
                         case_insensitive=False, intents=intents)
earnest phoenix
#

nodejs gods

#

is it okay to cache promisify results

quartz kindle
#

@earnest phoenix sure

tulip ledge
#

what do the public readonly keywords do?

#

cuz that doesntrlly look like javascript lol

quartz kindle
#

its typescript

#

they do what they imply they do

#

public means its not private, it can be used from anywhere, whereas private can only be used from inside the class

#

readonly is readonly, similar to const

onyx summit
#

Why not use the promises api straight away?

#

fs.promises has nearly all methods but they return promises

#

@earnest phoenix

quartz kindle
#

wait since when

earnest phoenix
#

oh?

#

i wasn't aware of this

quartz kindle
#

me neither lmao

onyx summit
#

Its a thing since V10 I think, but has been experimental for a while

#

Its stable now tho

quartz kindle
#

v15 also added timers/promises

split hazel
#

timers?

#

sounds neat

#

assuming you mean the timers I'm thinking of

#

eh they look useful for heartbeat timeout implementations

sudden geyser
#

What kind of timers?

brave scaffold
#

I have a question: is it possible for a Discord bot to send out a message in a text chat or DMs after someone has given a particular role to a member?

sudden geyser
#

Yes.

earnest phoenix
#

I- ..

#

my bot was declined for the NSFW API even though it was Verified before...

faint prism
#

Just make it NSFW only

sudden geyser
#

Then you'll have to change it.

#

In your case, you'll need to use a different API, as you can't use nekos.life's nsfw endpoint.

earnest phoenix
#

Fs, thats annoying.

#

I have Never ONCE, come across a "Minor" in the NSFW pictures,

pale vessel
#

you had good luck

earnest phoenix
#

nekos.life is full of creep weeaboo pictures that portray characters as children

pale vessel
#

aka lolis

#

you like em cry?

earnest phoenix
#

🤢

pale vessel
#

goood

earnest phoenix
#

it's crazy how this is gray area for most people when it shouldn't be even in question that it's a form of child porn

#

I understand that i guess, but what i'm confused about is why was it Declined Now, when it was verified before?

#

rules changed

#

Ah,

solemn latch
#

Wait, child porn is a grey area?

pale vessel
#

sounds like cuties

earnest phoenix
#

lolis are

solemn latch
#

Thats weird

earnest phoenix
#

insane

unique nimbus
#

Child Porn is illegal

#

but what classed as child porn is in the grey area

#

that is why the "She is actually a 7000yr demigod"

#

comes from

#

I think

solemn latch
#

If you can divide by 1000, then its the real age MegaThonk

unique nimbus
#

mmm

pale vessel
#

if her age is on the clock-

#

im sorry

sudden geyser
#

another one to add on the list

digital ibex
#

lol this conversation be like

pale vessel
#

truly a development moment

digital ibex
#

lmao

solemn latch
#

We all developed here tonight

earnest phoenix
#

nekos.life is full of creep weeaboo pictures that portray characters as children
@earnest phoenix use nekos.fun or neko-love api

#

Also it is now illegal to watch hentai related material in Australia

quartz kindle
#

Lol

#

the more you make it illegal, the more valuable it becomes and more money their artists will make

opal plank
#

so, bottom line, make everything illegal and work for more?

quartz kindle
#

yes, lets go rob a bank

opal plank
#

im down

#

robbing a bank has a higher chance accomplishing something than my noodle code

quartz kindle
#

xD

earnest phoenix
#

Random question on the whole upvotes thing when the upvotes get set to 0 why hasn't every application been set to zero at the same time

#

does anybody here know what the font being used for the discord code block markdown is called?

quartz kindle
#

@earnest phoenix caching and eventual consistency

earnest phoenix
#

thank you

clear elbow
#

i want to make my bot gives auto a role when a member joined i make this but nothing happens

pale vessel
#

isn't it ctx.author.add_roles(role)?

clear elbow
#

on member join to put a author ?

pale vessel
#

yes

clear elbow
#

ok let me try it

pale vessel
#

author is a member

#

it's a user when it is a DM

sharp pendant
#

how I can change the nodejs version of my vps it is currently under ubuntu 18.04

pale vessel
#

actually, doesn't the event send a member, not a context?

#

so ctx.add_roles() should work then

#

unless the dpy's command client handles it differently

clear elbow
#

so what to do 😛

#

i tryed with the member and i dint make it

earnest phoenix
#

@clear elbow should name that as member rather than ctx, since it's actually just a discord.Member object

clear elbow
#

i made it like this but still nothing

#

i can understand what is wrong i even didn't get any error in console

earnest phoenix
#

did you enable members intent?

clear elbow
#

no ?

#

what is that

#

:3

quartz kindle
#

in the discord developer portal

earnest phoenix
#

you would need to enable members intent in the developer portal and in your code when you defined the Bot's instance

clear elbow
#

ok 🙂 didnt khnow it

#

lets try again

#

nothing happens

earnest phoenix
#

@clear elbow how did you configure your intents?

dense void
#

Can someone help me make a lottery system for my discord bot. I'm trying to make the tickets like this 5 - 6 - 20 - 30 - 34 - 39 and the more numbers you get the higher the prize

#
function generate(size, lowest, highest) {
    var numbers = [];
    for(var i = 0; i < size; i++) {
        var add = true;
        var randomNumber = Math.floor(Math.random() * highest) + 1;
        for(var y = 0; y < highest; y++) {
            if(numbers[y] == randomNumber) {
                add = false;
            }
        }
        if(add) {
            numbers.push(randomNumber);
        } else {
            i--;
        }
    }
  
    var highestNumber = 0;
    for(var m = 0; m < numbers.length; m++) {
        for(var n = m + 1; n < numbers.length; n++) {
            if(numbers[n] < numbers[m]) {
                highestNumber = numbers[m];
                numbers[m] = numbers[n];
                numbers[n] = highestNumber;
            }
        }
    }
  
}```
clear elbow
earnest phoenix
#

you would need to enable them in your code

clear elbow
#

do you khnow how ?

earnest phoenix
#

sure, it's explained in the link i gave you

clear elbow
#

ok

slim heart
#
(async () => {
      const peer1 = new RTCPeerConnection()

      const peer2 = new RTCPeerConnection()

      peer1.ontrack = function ({ streams: [stream] }) {
        console.log(stream)
        document.getElementById('video-receive').srcObject = stream
      }

      window.peers = [peer1, peer2]

      const offer = await peer1.createOffer()
      await peer1.setLocalDescription(
        new RTCSessionDescription(offer)
      )

      await peer2.setRemoteDescription(
        new RTCSessionDescription(offer)
      )
      const answer = await peer2.createAnswer()
      await peer2.setLocalDescription(
        new RTCSessionDescription(answer)
      )

      await peer1.setRemoteDescription(
        new RTCSessionDescription(answer)
      )

      navigator.getUserMedia(
        {
          video: true,
          audio: true
        },
        stream => {
          stream.getTracks().forEach(track => peer2.addTrack(track, stream))
        },
        error = console.log
      )
    })()```
anyone have an idea why this isn't working? just testing out webrtc
the peer1.ontrack just never gets called
#

the navigator.getUserMedia also does receive a stream as local video does work, it just never gets transmitted

clear elbow
#

@earnest phoenix i use this intents = discord.Intents.default() intents.members = True for my job ?

earnest phoenix
#

sure, and pass that to the bot's constructor

#

bot = commands.Bot(command_prefix='!', intents=intents)
^ where you pass them

clear elbow
#

thanks god

#

❤️

#

u are a life saver

#

i was breaking my brain for about 3 hours

earnest phoenix
#

okie

abstract perch
#

Hey, I would like to send a message when a member gets unmuted but the moment I mute the member, it sends the UNmuted Embed.

#

is there a way to wait and then send the embed?

#

I have been trying different ways but nah

sudden geyser
#

Add it in the timeout.

pale vessel
#

send it inside the timeout, yea

sudden geyser
#

Though, if you want a reliable mute/unmute command, a timeout won't do the job.

abstract perch
#

oh it works

sudden geyser
#

You'll need to schedule and save it in a database to make it persistent.

abstract perch
#

oof

valid frigate
#

well

#

there are multiple ways to approach it

#

you could take the approach of setting an initial time out but also setting the unmute time in a redis instance

#

then if your bot restarts set new timeouts for all the times in the redis instance

abstract perch
#

I see

#

I see what you mean

#

Add it in the timeout.
@sudden geyser ok that worked, thank you

#

I will probably store it on redis in the future

sudden geyser
#

Vysion tbh I don't think adding a bunch of new timeouts is the way to go either, as you're binding and making functions that live for a long time until they can be called once and go away. It doesn't sound good for your memory, but only good in the case of accuracy (when to unmute).

drifting wedge
#

how can i use wait for in python to run code when a specific reaction is added?

dense nest
#

Idk my brain just cant figure it out lol

earnest phoenix
#

on_voice_state_update gets 3 pos arguments, but you only put 2 pos arg

dense nest
#

So

#

What do i gotta add

#

👀

earnest phoenix
#

you miss member

dense nest
#

Im smort

earnest phoenix
#

perhaps

dense nest
#

Its just 10pm and I'm super sleep deprived

#

Lmao

#

Thanks

earnest phoenix
#

okie

quartz kindle
#

isnt the error message wrong?

#

its saying "it takes 2 but 3 were given", which implies the opposite lol

earnest phoenix
#

not really

dense nest
#

I need to get guild

#

Without using ctx

sudden geyser
#

What do you have then

#

Do you have a message

dense nest
#

But i can't use ctx

earnest phoenix
#

it's due to how discord.py works, if you setup on_voice_state_update (before, after), it will try to call it as on_voice_state_update (member, before, after), hence the error @quartz kindle

dense nest
#

Bc its an event

#

Amd its being gay

earnest phoenix
#

@dense nest you can get the guild object from member, member.guild would do it

sudden geyser
#

If you have a member instance, you should be able to do member.guild

dense nest
#

Ok

#

Thanks again lol

dense void
opal plank
#

what are you even trying to do? @dense void

dense void
#

im just trying to make a lottery system

opal plank
#

lottery as in one win or lottery as in multiple rewards?

dense void
#

multiple rewards

#

so if i get 3 of 5 numbers right i get some money, and if i get 5 out of 5 numbers right i get the big prize

opal plank
#

isnt that a slot machine though?

#

well, not quite

#

hmmm

dense void
#

either way i've been trying to figure this out all dayy

opal plank
#

which language you using/

dense void
#

javascript

opal plank
#

lemme see if i can come up with something not so gross rq

dense void
#

okieee tysmmm!

#

genuinely really appreciated

sudden geyser
#

Nolo may I ask what you used to make that flowchart?

dense void
sudden geyser
#

ty

dense void
#

no worries. i used the zen template btw

pale vessel
#

Lite: May I ask what theme you used for that flowchart?

#

erwin, there's no way you're typing the whole code using the chat

dense void
#

it would seem so 💀

opal plank
#
//index 
let rewards:Map<id,reward> = new Map(), entries:Map<id,User> = new Map();


//command to get a loterry ticket
entries.set(user.id, {wins: 0});


//roll winners
//firstly, generate the rewards. in this case, 10 small prizes of 10 and 1 big prize of 200

//generate small prizes
const prizeAMount:number = 10;
for (let i = 0; i < prizeAmount; i++) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
rewards.set(randomNumber, 10)
}
//now the map has a 10(small chance of repetitions, account for this) on rewards
//set big prize the same way

const bigprizeAMount:number = 1;
for (let i = 0; i < bigprizeAMount; i++) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
rewards.set(randomNumber,200)
}

//now lets roll winners
for(let user of entries.keys()) {
let randomNumber:number = Math.floor(Math.random() * (entries.size)) + 1;
if(rewards.has(randomNumber)) /*user won a prize*/ {
if(entries.get(user)?.wins > 1) return //user already won once, this prevents them from winning too much(as standart from cassinos)
else {
entries.get(user)?.wins = 1) //send fancy embed here and update their currency based on the amount, remember the reward map also contains the amount of money they earned.
}
}
};

@dense void something like this should work

earnest phoenix
#

The hell, is that js or ts

opal plank
#

ts

#

just watch and see

dense void
#

i haven't done anything yet and i've gotten an error

opal plank
#

@earnest phoenix understood why now?

#

@dense void what i gave you is a framework, not spoonfed code, we arent allowed to spoonfeed

#

js and ts are basically the same, you should take a look at what i did and make something similar

dense void
#

okie ty

opal plank
#

not full on copy it

earnest phoenix
#

The reason it gave an error because you're executing TS code on a JS file

opal plank
#

wouldnt work either cuz there are 2 syntax errors

delicate shore
#

My event handler won't work

sudden geyser
#

Do you know why it doesn't work

dense nest
#

How can I send a message in chat without ctx? Bc im using an event

gleaming dove
#

$ {client.users.size} New Version of This How?

rocky hearth
#

Does anyone have used Erela.js?? Is there any quota limit in that?

earnest phoenix
#

@rocky hearth dont know it but i will do some research, brb.

#

hi

#

By quota you mean ratelimit yes?

#

$ {client.users.size} New Version of This How?
@gleaming dove client.users.cache.size for d.js v12+

rocky hearth
#

Till now I was using YouTube api v3, but dont know how, its quota limit has exceeded

earnest phoenix
#

Ah

#

Youtube api have quota

rocky hearth
#

I can't search song anymore

earnest phoenix
#

But erela js itself doesnt have quota

#

why can't people just listen to songs together on spotify instead of risking legal action from youtube for music bots

rocky hearth
#

I haven't search any songs today, and my bot was also offline, but still it still generates error, for qouta limit exceed

earnest phoenix
#

Ah

#

Let me dig the source code rq

rocky hearth
#

code913, its just like that 😄

earnest phoenix
#

bad boi

#

You using your own api key?

rocky hearth
#

yes

earnest phoenix
#

Lavalink yes?

rocky hearth
#

I never used lavalink yet

earnest phoenix
#

Idk where you put api key

#

Anyways idk how it work but

#

Maybe check your google api qctivity log

rocky hearth
#

I use the package called googleapis,

earnest phoenix
#

Ah

rocky hearth
#
import { google } from 'googleapis';
const youtube = google.youtube( 'v3' );
await youtube.search.list( {
      // @ts-ignore
      key: YOUTUBE_API_KEY,
      part: 'snippet',
      q: query + ', music',
      type: searchType,
      maxResults
      // @ts-ignore
    }).then(response => response.data.items)
      .catch(console.error);
earnest phoenix
#

Idk why but its probably because the api is being used iy

rocky hearth
#

How can it is being used, my bot is not hosted anywhere,
But yes my laptop was at sleep whole night, but still I kept my bot offline

earnest phoenix
#

what does the character \ do in JS strings

slender thistle
#

Escape whatever comes after

earnest phoenix
rocky hearth
#

That character is used to escape some character that is not able to be printed normally, like

console.log('What\'s Up');
// Now it should print, What's Up
slender thistle
#

'\'\'' to output two apostrophes for example

earnest phoenix
#

okie