#development

1 messages ยท Page 832 of 1

celest viper
#

lol

narrow kettle
#

[Python] how can I remove all word duplicates from a string/list, example: lets say I have a string that is "Hello Im Hello Pynter Im" so I need it to be "Hello Im Pynter"

solemn quartz
#

How much time ago? -__-

earnest phoenix
#

I found it

#

but when i do canalestatusbot.send "send" appears as a word and not a object

#

@solemn quartz ^

pale vessel
#

what appears as a word?

narrow kettle
#

just a word, lets say if i have two ',' in it i want to keep them

celest viper
#

@narrow kettle arrays.pop(number in the list)

narrow kettle
#

thanks, I'll look into it :>

earnest phoenix
#

@solemn quartz do you want to send an embed?

solemn quartz
#

yea

earnest phoenix
#

You need to use

#

@narrow kettle "".join({*message.split(" ")}) maybe

#

not sure if it keeps order

#

canalestatusbot.send({botOnline})

#

@solemn quartz

solemn quartz
#

thank you

#

ima test it

pale vessel
#

send(embed) works too

earnest phoenix
#

@narrow kettle something like "".join(OrderedSet(message.split(" "))) possibly

#

@pale vessel he renamed it

late hill
#

He said python

pale vessel
#

o h

earnest phoenix
#

who what python?

late hill
#

Pynter

earnest phoenix
#

Pynter

#

that is python

pale vessel
#

there's too much people that need help

earnest phoenix
#

ah yeah

pale vessel
#

i was talking to bg super

earnest phoenix
#

ah hahah

celest viper
#

array.pop(number in the list) works to @earnest phoenix

earnest phoenix
#

right. but you'll have to find the duplicates yourself

#

which is pain

golden condor
#

Would this work for aliases

#
if(!client.commands.get(cmd.slice(prefix.length)) || !client.aliases.get(cmd.slice(prefix.length))) return;    
    client.commands.get(cmd.slice(prefix.length)).run(client,message,args);
   client.aliases.get(cmd.slice(prefix.length)).run(client,message,args);```
#
 if (command.aliases && Array.isArray(command.aliases)){ command.aliases.forEach(alias => client.aliases.set(alias, command.name));}```
celest viper
#

it's not python

earnest phoenix
#

whats not python?

golden condor
#

Ik and I am aware

earnest phoenix
#

It's js

#

^

#

lmaooooo

#

anyway.

golden condor
#

I didn't accidentally code js while tryna code python

earnest phoenix
#

Lmao

solemn quartz
#

@earnest phoenix it doesnt work

#

ill send u the error

earnest phoenix
#

@golden condor ok so i don't think client.aliases.get(cmd.slice(prefix.length)) requires aliases to be the same length as prefix

#

Try {embed: botOnline}

golden condor
#

No

pale vessel
#

like i said send(embed) or send({embed: embed}) works

earnest phoenix
#

@earnest phoenix python

golden condor
#

It removes the prefix from the alias

earnest phoenix
#

@earnest phoenix that's js

solemn quartz
#

idk

earnest phoenix
#

who what language

#

@solemn quartz what lang

pale vessel
#

js

solemn quartz
#

btw the error is
(node:12340) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
at C:\Users\nope\Desktop\Super Bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at C:\Users\nope\Desktop\Super Bot\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:12340) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:12340) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

earnest phoenix
#

canalestatusbot.send({embed: botOnline}) @solemn quartz

#

@golden condor ahhh right so not the command hahah

golden condor
#

Yeah

pale vessel
#

command handler

golden condor
#

I was tryna add aliases to my bot

earnest phoenix
#

however. i think what u want is slice(0, prefix.length)

#

no?

#

ignore me

#

im dumb

#

Same

pale vessel
#

all right, where did you define the commands?

golden condor
#

It works fine for commands

earnest phoenix
#

ok so how does client.commands.get work

pale vessel
#

client.commands?

golden condor
#

I have client.commands = new Discord.Collection()

pale vessel
#

what does it contain?

#

name and command?

earnest phoenix
#

whats a discord collection thonk

pale vessel
#

map

golden condor
#

Commands

pale vessel
#

basically

#

just commands?

solemn quartz
#

canalestatusbot.send({embed: botOnline}) @solemn quartz
@earnest phoenix IT WORKED

#

FUCK YEAH

earnest phoenix
#

ah found it

#

@solemn quartz ik

solemn quartz
#

now i set the color :p

earnest phoenix
#

do all your commands not have arguments?

golden condor
#

Now my command handler doesn't work at all lmao

pale vessel
#

revert

earnest phoenix
#

what was it before?

#

or what did u add

golden condor
#

I need a way to add aliases the same way that commands

#

It was before

earnest phoenix
#

did u touch the command part

golden condor
#

But now it doesn't work

#

i am gonna load a backup

earnest phoenix
#

no right? the slice and commands.get is still fine?

golden condor
#

That was always fine

pale vessel
#

i'm guessing it's something like client.commands.get("ping") to fetch the command

earnest phoenix
#

*is still identical to original?

#

I have code for aliases but my command handler is different

#

ok

golden condor
#

Yes

#

But it uses the command the user types

#

Like c![COMMAND]

pale vessel
#

don't worry

earnest phoenix
#
    client.commands.get(cmd.slice(prefix.length)).run(client,message,args);
   client.aliases.get(cmd.slice(prefix.length)).run(client,message,args);
#

hmm

#

It gets the args

pale vessel
#

you can put || and find the alias

earnest phoenix
#

He/she already used slices

#

client.aliases.set(alias, command.name)

golden condor
#

Yeah but that won't work it

earnest phoenix
#

here might be the problem?

golden condor
#

Already done that

earnest phoenix
#

thats the problem

golden condor
#

In index.js

earnest phoenix
#

set it to command not command.name

pale vessel
#

define the aliases inside the command

golden condor
#

I have

earnest phoenix
#

or, lookup the command after looking up the alias

#

hmmmm

#

you have what

golden condor
#

Like this

pale vessel
#

in the collection, there should only be command name and the command itself

golden condor
#

aliases: ['ex', 'ex']

#

I have two collections

pale vessel
#

you can access the command and find the alias

earnest phoenix
#

in the foreach

golden condor
#

aliases

earnest phoenix
#

what do u set it to

golden condor
#

andcommands

earnest phoenix
#

set(what, what)?

pale vessel
#

don't make it complicated

golden condor
#

hold on glitch is spassing out

#

Glitch is fucking down again

pale vessel
#

maybe I can help on glitch?

earnest phoenix
#

if u have the command name in aliases.
client.commands.get(client.aliases.get(cmd.slice(prefix.length))).run(client,message,args);

#

-_- rip

golden condor
#

Hold on

earnest phoenix
#

u have bad wifi

golden condor
#

I am loading up vsc and the glitch extension

earnest phoenix
#

or ur bot kills glitch

#

Glitch is always down

golden condor
#

i don't

earnest phoenix
#

๐Ÿคฆโ€โ™‚๏ธ

#

oh it is down

golden condor
#

Yeah Arun is right

earnest phoenix
#

Glitch is glitch

golden condor
#

client.commands.set(commandName, command);
if (command.aliases && Array.isArray(command.aliases)){ command.aliases.forEach(alias => client.aliases.set(alias, command.name));}

earnest phoenix
#

nvm its back

#

right. so it's the name

golden condor
earnest phoenix
#

f

golden condor
#

I have it open using the vsc extension

earnest phoenix
#

so you'll have to get it from commands after getting from aliases, no?

pale vessel
#

you just need to put aliases inside the command and access it from client.commands. that's it

earnest phoenix
#

wat

#

wat

golden condor
#

so

#

client.commands.aliases?

earnest phoenix
#

ew no

#

No never

golden condor
#

oH

earnest phoenix
#

try client.commands.get(client.aliases.get(cmd.slice(prefix.length))).run(client,message,args);

#

because alias is the name right?

#

You're making it complicated

golden condor
#

No

earnest phoenix
#

so its tryin to run the name

golden condor
#

Like I have h

#

I have the command name

pale vessel
#

client.aliases waitWhat

golden condor
#

And then I want other version

pale vessel
#

you don't need it.

earnest phoenix
#

Your pfp define your reaction @earnest phoenix

golden condor
#

Like say avatar and pfp

pale vessel
#

you just need to put aliases inside the command and access it from client.commands. that's it

earnest phoenix
#

but you did this right client.aliases.set(alias, command.name)???

golden condor
#

Yes

earnest phoenix
#

exactly.

golden condor
#

Wait

#

No

earnest phoenix
#

oh

#

hahah

pale vessel
#

what's inside your command file? let's say ping

golden condor
#

Ok

#

I will show you just a second

grizzled raven
#

are <reaction>.users.size and <reaction>.count always the same?

earnest phoenix
#

so. then it's client.aliases.set(alias, command)?

#

@grizzled raven should be, yes

pale vessel
#

don't let him do that

golden condor
#
if (!client.commands.get(cmd.slice(prefix.length)) || !client.commands.get(client.aliases.get(cmd)))return;    
    client.commands.get(cmd.slice(prefix.length)).run(client,message,args);
       if (client.aliases.has(cmd.slice(prefix.length).toLowerCase())) {
        client.commands.get(client.aliases.get(cmd.slice(prefix.length).toLowerCase())).run(client, message, args)
       }``` What about this
earnest phoenix
#

ok so depends whether u have client.aliases.set(alias, command.name) or not tbh

pale vessel
#

can you console log your client.commands?

earnest phoenix
#

if client.aliases.set(alias, command) then the original should work fine

#

if it's client.aliases.set(alias, command.name) then this new version should work

#

@earnest phoenix mo

#

No

#

also one thing. i'd put cmd.slice(prefix.length) and cmd.slice(prefix.length).toLowerCase() in a variable

pale vessel
#

stop

#

making things complicated

earnest phoenix
#

If he did it cmd.run will not work

golden condor
#

I'm sorry I am really confused

earnest phoenix
#

@pale vessel explain how your thing would work then

pale vessel
#

Cxllm

golden condor
#

I'm sorry

earnest phoenix
#

Somebody is confusing you

pale vessel
#

client.commands should have only the command name and the command itself, which have the aliases needed

golden condor
#

Yes

earnest phoenix
#

client.commands is a dictionary yea

golden condor
#

Ok

earnest phoenix
#

ahhhhhhh

#

of course -_-

#

Yeah why you need client.aliases

pale vessel
#

you can access client.commands and see if the alias exist inside a command

earnest phoenix
#

yeah client.commands.set(alias, command)

#

-_-

golden condor
#

Can't you just access the command file?

earnest phoenix
#

ehh

pale vessel
#

that's what I said

earnest phoenix
#

that's even more complicated

pale vessel
#

no?

earnest phoenix
#

No it's not

#

"inside a command"

#

not what u said

pale vessel
#

learn module.exports

earnest phoenix
#

More like getting string from object

golden condor
#

Can't you also do

#

exports.aliases

earnest phoenix
#

what i suggest is setting 2 keys in command to the same thing

#

@earnest phoenix congratulations i guess but this isnt place for that

#

Yep

golden condor
#

Please don't make me more confused if possinle

#

Nicw

#

Right this is my code in handling it

#
    let command = require(`./commands/${file}`);
    let commandName = file.split(".")[0];
    client.commands.set(commandName, command);
    if (command.aliases && Array.isArray(command.aliases)){ command.aliases.forEach(alias => client.aliases.set(alias, command.name));}```
earnest phoenix
#

Send a format of your commands @golden condor

golden condor
#

Ok

pale vessel
#

okay. do this: console log the command collection

golden condor
#

k

#

Collection [Map] {}Collection [Map] {}

pale vessel
#

......

#

ok

earnest phoenix
#

stop

#

making this complicated

golden condor
#

Wait no

earnest phoenix
#

@golden condor lets try the easy way

pale vessel
#

you're the one who does that

golden condor
#

Wrong thing sorry

solemn quartz
#

@earnest phoenix if i want to do the same thing, but when it is offline how do i do this?

earnest phoenix
#

client.commands.set(alias, command)

pale vessel
#

no.

solemn quartz
#

bot.off('ready', bla bla)

pale vessel
#

on*

solemn quartz
#

i dont think ready statuys good with off lol

golden condor
#

I will show

earnest phoenix
#

Use disconnect

solemn quartz
#

?

golden condor
solemn quartz
#

disconnect is for voice channels

earnest phoenix
solemn quartz
#

nope

earnest phoenix
#

Then nothing

golden condor
#

๐Ÿคฆโ€โ™‚๏ธ

earnest phoenix
#

try what i said cxllm

solemn quartz
#

i think im going to figure it out my self

golden condor
#

What did you say

pale vessel
#

if it's offline, how can it send a message

earnest phoenix
#

client.commands.set(alias, command)

#

Bot never have event off

#

@pale vessel lol

#

because it's not like the ever conflict right?

pale vessel
#

what's command?

#

what did you define command as?

earnest phoenix
#

an object

#

with run

golden condor
#

The aliases are already set!

pale vessel
#

require(command)?

earnest phoenix
#

read the pastebin @pale vessel

golden condor
#

Look at the hastebin!

earnest phoenix
#

@golden condor i mean put them in the command lookup

pale vessel
#

the just put aliases inside the command object

golden condor
#

How

earnest phoenix
#

so if u commands.get an alias

#

its already there

#

client.commands.set(alias, command)

pale vessel
#

aliases: ["pong"]

earnest phoenix
#

it adds a new command with name = the alias, command = the same thing

#

right?

solemn quartz
#

should i make a webhook that say that?

earnest phoenix
#

You don't need client.aliases

pale vessel
#

Yes

earnest phoenix
#

^

pale vessel
#

Exactly

golden condor
#

Ok

earnest phoenix
#

flaz u makin it complicated tho

#

It's never defined lol

golden condor
#

In the message event waht do I do

earnest phoenix
#

wait

#

bruh fr? didnt catch that

golden condor
#

I mean

earnest phoenix
#

@golden condor use the old code

golden condor
#

message.js

earnest phoenix
#

the only line u need to add from the working version

#

The format you send

#

is this

#

Have cmd.run

#
if (command.aliases && Array.isArray(command.aliases)){ command.aliases.forEach(alias => client.commands.set(alias, command));}
#

Run and aliases

golden condor
#

Ok

#

This is my code

#
const config = require("../config.json")
let prefix = "c!"  
const Discord = require("discord.js")
const fs = require("fs")

 exports.run = async(client, message, msg) => {
  if (message.author.bot) return;
if (message.channel.type == "dm") return ;
const db = require('quick.db')
let prefix = await db.fetch(`prefix_${message.guild.id}`);
    if (!prefix) {
      prefix = 'c!'
    }
  if (message.content.startsWith(prefix)) {

 let messageArray = message.content.split(" ");
  let cmd = messageArray[0];
  let args = messageArray.slice(1);

if(!client.commands.get(cmd.slice(prefix.length))) return;    
    client.commands.get(cmd.slice(prefix.length)).run(client,message,args);
  
    
 }
 }```
earnest phoenix
#

if it's offline, how can it send a message
they actually can, sending messages is a REST endpoint, you don't have to be connected to the gateway for it

#

@earnest phoenix ๐Ÿคฆโ€โ™‚๏ธ

#

ya

#

what @earnest phoenix ?

#

that should work if u set up the commands with that new line

slender thistle
#

What credentials are needed to post a message, again?

golden condor
#

Not working

earnest phoenix
#

It'll not

golden condor
#

Do I have to add an extra line to detect aliases

earnest phoenix
#

no wait

#

hang on

#

What credentials are needed to post a message, again?
it's literally an api endpoint, you just need the token in the Authorization header

#

do u have the thing with client.commands.set(alias, command)

golden condor
#

Yes

earnest phoenix
#

Yeah and it make your bot online @earnest phoenix

#

weird.

#

what @earnest phoenix

golden condor
#

Actually

#

No

earnest phoenix
#

right below the client.commands.set(commandName, command); right

#

hahah

#

We are talking about bot is offline like fully not offline status

golden condor
#

In the commands

earnest phoenix
#

yes and?

#

the bot can still send messages

pale vessel
#

cxllm if you let me see your glitch project I can probably help you

earnest phoenix
#

are you blind

solemn quartz
#

So guys?

golden condor
#

Ok

slender thistle
#

it's literally an api endpoint, you just need the token in the Authorization header
Not sure what I was expecting ๐Ÿคฃ

golden condor
#

I will dm you

pale vessel
#

ok

#

jeez

solemn quartz
golden condor
#

I'll remove the token

earnest phoenix
#

You use token for sudden moment it'll connect your bot to gateway

#

@golden condor not talking to you

golden condor
#

I am taling to flazeoe

solemn quartz
#

*flazepe

#

^

earnest phoenix
#

you DON'T NEED TO LOGIN

#

holy shit

golden condor
#

Yeah I made a spelling mistake

solemn quartz
earnest phoenix
#

But still it needs to connect to discord api

#

are you blind my dude

#

it doesn't need to connect to the gateway

solemn quartz
#

when someone answrs to it ping me

earnest phoenix
#

@solemn quartz

solemn quartz
#

what

earnest phoenix
#

Cry can help you

#

He is genius

#

๐Ÿ‘

#

-_- bruhhhhhhh

solemn quartz
#

lol

earnest phoenix
#

@golden condor -_- it should literally just be 1 line tbh

solemn quartz
#

Hey cry! I seeeeeeeeeeeeeeeeeeeeeeeeeeeee youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

golden condor
#

What?

earnest phoenix
#

not sure what flaz is sayin but sounds complicated

#

this thing
if (command.aliases && Array.isArray(command.aliases)){ command.aliases.forEach(alias => client.commands.set(alias, command));}

fallen arch
#
category = await message.guild.channels.create("////////////", {
              type: "category",
              position: 0
            })
```how can i make the category be at the top?
slender thistle
#

But still it needs to connect to discord api
@earnest phoenix It doesn't need a gateway connection
You just send a HTTP request with your bot's token for auth

earnest phoenix
#

because clearly the client.commands.set(commandName, command); is working right

solemn quartz
#

wtf is that @earnest phoenix

slender thistle
#

It's a one-time HTTP request comrade

earnest phoenix
#

postman

#

you don't need that

#

it's just to prove that it's an API request

cursive dagger
#

@earnest phoenix Discord bots need to connect and identify to the gateway to send a message

earnest phoenix
#

Oh post

#

Discord bots need to connect and identify to the gateway to send a message
no they do not

solemn quartz
#

@earnest phoenix bro

earnest phoenix
#

look at the image above

solemn quartz
cursive dagger
earnest phoenix
#

Gateways are Discord's form of real-time communication over secure WebSockets

#

yup

cursive dagger
#

they have to connect once

earnest phoenix
#

that says ONCE

cursive dagger
#

yes

earnest phoenix
#

in a lifetime of the app

cursive dagger
#

yeah

earnest phoenix
#

But that sudden moment of time it connects

#

gateway is only if you want websockets is it?

solemn quartz
#

i dont even know

earnest phoenix
#

yes

solemn quartz
#

oh lol

earnest phoenix
#

and to people who say you need to be connected to the gateway to send them

#

you do not

solemn quartz
#

so how the fuck do i fix it?

earnest phoenix
#

whats broken

solemn quartz
#

nothing

#

lol

earnest phoenix
#

-_-

#

then what

solemn quartz
#

i didnt even started scripting it

earnest phoenix
#

oh

solemn quartz
#

Idk how to do that

golden condor
#

@earnest phoenix what you said worked

#

Thanks

earnest phoenix
#

๐Ÿ‘Œ

#

feels a bit hacky

#

but i mean it's basically the simplest way to do it so blobshrug

#

look for your library's disconnect event

golden condor
#

thanks

fallen arch
#
category = await message.guild.channels.create("////////////", {
              type: "category",
              position: 0
            })
```how can i make the category be at the top?

@fallen arch anyone know why?

earnest phoenix
#

once the event fires, grab your channel and send a message to it

#

@solemn quartz http POST request

#

I already told him about disconnect event

#

@fallen arch u want to move the category?

fallen arch
#

when creating

earnest phoenix
#

hmm

fallen arch
#

i want the category to be at the top

earnest phoenix
#

?

#

Can you elaborate it more

solemn quartz
#

do i do something like this?

#

bot.off('ready', () =>{
const botOffline = new Discord.RichEmbed()
.setTitle('Sono Offline!')
.setThumbnail(${bot.user.avatarURL})
.setColor('idk what red hex color is');
const botsupportserver = bot.guilds.find(guild => guild.id === "673538782707974196")
const canalestatusbot = botsupportserver.channels.find(channel => channel.id === "691244815861547058")
canalestatusbot.send({embed: botOnline})
})

#

idk how to do this

earnest phoenix
#

Bot.off isn't something

solemn quartz
#

yep

earnest phoenix
#

position 0 not working huh...

#

@fallen arch where is it creating it

solemn quartz
earnest phoenix
#

it'll show up with anything you type in

#

the autocomplete isn't valid because js isn't typed

#

the IDE/editor doesn't know what exists and what doesn't

#

IDE knows if u have an extension for your library

#

or a good linter/extension

solemn quartz
#

OKAY

earnest phoenix
#

^

#

however. discord.js doesn't look like it has .off no

fallen arch
#
category = await message.guild.channels.create("MEMBER COUNT", {
              type: "category",
              position: 0
            })

this is creating the category

earnest phoenix
#

also .off('ready' doesnt make sense anyway

#

ya where is it placed @fallen arch

#

READY is an event fired by discord through the gateway to tell you that your bot has finished receiving all available guilds

fallen arch
#

at the bottom

earnest phoenix
#

@earnest phoenix he is a beginner

fallen arch
#

it is defaulted to the bottom
but i want it to be at the top

solemn quartz
#

@earnest phoenix he is a beginner
@earnest phoenix fuck you : )

earnest phoenix
#

how many categories u already have

#

can i stop getting pinged

solemn quartz
#

i always watch this chat

#

i stalk this chat

fallen arch
#

in any guild i want it to be at the top

earnest phoenix
#

u have more than like 3 categories right

solemn quartz
#

also .off('ready' doesnt make sense anyway
@earnest phoenix ik lol

earnest phoenix
#

hmmm

hollow granite
#

Is there a event for a reactionCollector that detects when someone removes a reaction from a message? right now I have it on collection.on("remove") but its still not working :/

earnest phoenix
#

hmmm

solemn quartz
#

?

earnest phoenix
#

@solemn quartz that's for shard

#

reactionCollector?

#

hmm

solemn quartz
#

then im fucking ded

fallen arch
#

u have more than like 3 categories right
@earnest phoenix yes

earnest phoenix
#

Wait

#

Try and see is best

#

wait

robust moth
#

How To Keep my Bot Online 24/7

earnest phoenix
#

weird...

solemn quartz
#

im just gonna watch a bad yt video on how to make a webhook make a message when the bot goes down

earnest phoenix
#

@hollow granite read the docs. they state that the remove event is only fired when all reactions are removed, dispose event is fired when a single reaction is

#

@robust moth host it on vps

#

@earnest phoenix wrong

#

it's the other way around

#

nevermind

#

yeah

#

Will emit on all reaction removals, as opposed to Collector#dispose which will only be emitted when the entire reaction is removed.

#

hahah yeah

#

which is weird

robust moth
#

@earnest phoenix i am using glitch

earnest phoenix
#

@hollow granite u console.logged inside the on('remove' to see if it's working?

#

Ask glitch support @robust moth

#

We're not glitch

#

^

#

glitch turns off by default

#

stop using free hosting

#

@earnest phoenix they can

#

i never said they can't

#

And they will maybe they don't have money

robust moth
#

I know thak @earnest phoenix

earnest phoenix
#

hmm

celest viper
#

ouh

#

exposed

earnest phoenix
#

?

#

what happened

#

if u mean that it's not a real "hack" the glitch people posted there and are fine with it

#

anyway... re: category

#

lookin through the docs and they renot helping ๐Ÿ˜ฆ

hollow granite
#

Yeah, i've tried both dispose and remove but i havent got either to work. But collect works just fine. Maybe i am making a dumb mistake?

const filter = (reaction, user) => user.id == msgAuthorID
const collector = await startMsg.createReactionCollector(filter, { time: timer * 1000 });

collector.on('remove', (reaction, user) => {
  console.log("REMOVED")
})
collector.on('dispose', (reaction, user) => {
  console.log("DISPOSED")
})
collector.on('collect', (reaction, user) => {
  console.log("COLLECTED")
})```
earnest phoenix
#

wut indeed

earnest phoenix
#

maybe permissions idk tbh

#

@robust moth check glitch status

#

They always have a glitch

storm bluff
#
at Object.run (/app/commands/guild/autorole.js:59:98)
at Client.<anonymous> (/app/luffy.js:117:13)
    at Client.emit (events.js:201:15)
    at MessageCreateAction.handle (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:435:22)
    at WebSocketShard.onMessage (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/discord.js/12.0.2/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
    at WebSocket.onMessage (/rbd/pnpm-volume/228a8c0d-8425-40da-b0ab-ae02f7a524e3/node_modules/.registry.npmjs.org/ws/7.2.3/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:196:13)
(node:29419) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:29419) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
#

help

earnest phoenix
#

have you tried reading the error

storm bluff
#

yes

earnest phoenix
#

and what does it say

storm bluff
#

idk LOL

earnest phoenix
#

then you haven't

storm bluff
#

now what's problem

earnest phoenix
#

What's code

storm bluff
#

autorole

earnest phoenix
#

I said send the code

storm bluff
earnest phoenix
#

The

#

Problem is chnnel

#

๐Ÿคฆโ€โ™‚๏ธ

storm bluff
#

LOL ๐Ÿคฆ

quartz kindle
storm bluff
#

thanks

quartz kindle
#

lmao

earnest phoenix
#

@quartz kindle yeah lmao

#

Real dev finds a solution first before asking

#

๐Ÿ‘

#

real devs debug before asking stupid questions

quartz kindle
#

real devs rarely ever need to ask questions

solemn quartz
#

guys

#

i think i will wait 52104129401824184012084 years before of doing that bot.off thing

gloomy seal
#

I WANT TO DEVELOPE MY OWN BOT MUSIC HOW CAN HELP ME PLLEAS

modest maple
#

can you calm the fuck down first?

hollow granite
#

I finally got the reaction Collector to work. All i needed was to add "dispose: true" to the collector options ๐Ÿ™ƒ

gloomy seal
#

what ?

earnest phoenix
#

i love this

modest maple
#

so

#

soo soo soo much

#

why do you override it so many times

#

with diffrent things

earnest phoenix
#

people giving an error and a bible of code, without giving a second thought, expecting other people will magically solve and fix the code for them.

#

debug people, learn to debug

blissful scaffold
#

debugging is the most important skill developers have

#

even the best dev will make mistakes and will need to debug their own code or the code of others

earnest phoenix
#

it's essential to being a developer in the first place lmao

quiet rampart
#

how long does it take for a bot to get verified

earnest phoenix
celest viper
#

it depands

royal portal
#

Uhh

#

I upgraded both node.js and discord.js

#

A function has changed

#

member.guild.channels.find

#

Anyone know what the new one is?

gloomy seal
#

i want help 636112293297520640

modest maple
#

iirc they changed it to cache now

hollow granite
#

i think its member.guild.channels.cache.find

royal portal
#

so would it be

celest viper
#

it changed?

royal portal
#

member.guild.channels.cache.find?

modest maple
#

v12 gotta use .cache alot of the times now

#

maybe

#

tias

royal portal
#

let me test

earnest phoenix
#

read the docs

hollow granite
tight heath
#

or just use fetch mmweeeeeee

modest maple
#

Or just use python

earnest phoenix
#

imagine using interpreted languages

celest viper
#

@royal portal syntax error member.guilds.channels.find

tight heath
#

imagine using anything but go

earnest phoenix
#

fetus deletus

royal portal
#

I fixed it

#

member.guild.channels.cache.find

tight heath
#

that's one long ass string

#

... and this is why my d.js version is pinned before the cache update

modest maple
#

idk about u but i really cant be fucked to use a compiler on AI

royal portal
#

i used to use setStatus

#

but it doesnt work for me

#

for some reason

modest maple
#

or bother learning CPP ai

earnest phoenix
#

how many commands to get accepted

royal portal
#

and setActivity stops working after like 4 hours

celest viper
#

@royal portal use client.user.setActivity

#

for me it works

#

24/7

slender thistle
#

imagine using interpreted languages
I'm ngl, I don't regret learning Python
It's actually easier for me to calculate stuff with it

celest viper
#

compiled languages are better and faster like c++

royal portal
#

@celest viper well no because i have bot.on

celest viper
#

so use bot.user.setActivity

royal portal
#

I did tho

#

it stopped working after a few hours

celest viper
#

how do you host your bot

royal portal
#

through my raspberry pi 3

#

node.js

slender thistle
#

I don't need "faster" in my case

celest viper
#

no

slender thistle
#

Though compiled is cuter

celest viper
#

use github and heroku

#

better

#

return bot.handleVideo ?

royal portal
#

setActivity isnt working for me

unique nimbus
#

Debugging is amazing, especially when you use print or console.log to find where it stops

earnest phoenix
#

@royal portal version

#

isn't it setPresence, not setActivity

#

yes

royal portal
#

latest

celest viper
#

show me all your code @royal portal (not the token)

earnest phoenix
#

setPresence not setActivity then @royal portal

royal portal
#

its just the first part

#

setPresence('idle')>

#

?

earnest phoenix
#

nevermind setActivity exists too

#
client.user.setPresence({
        activity: {
            name: "bots cant get viruses",
            type: "PLAYING"```
#

i odo that

#

i do that

#

activity != status

royal portal
#

@earnest phoenix I mean the activity

earnest phoenix
#

do you want to set the activity or the status

royal portal
#

as in idle

heavy marsh
#
    const emojiList = message.guild.emojis.cache;
    let emojis = emojiList.slice(0, 10);
    if (emojis.length < 1) emojis = [`\u200b`];

How can I get the first 10 emojis from a guild? - discord.js v12

pale vessel
#

y tho

earnest phoenix
#

idk

#

but you did already, director

heavy marsh
#

Not working

celest viper
#

.slice(0, 9);

earnest phoenix
#

i hope you're aware that the emojis are objects, not strings

heavy marsh
#

it says slice is not a funtion

celest viper
#

wut is your error log

earnest phoenix
#

and cache is also an object

#

not an array nevermind

narrow kettle
#

[Python] How can i break the loop threw a if? example:
For x in range(5)
if(x == 3)
break(here i want to break out of the loop, not just the if)

print("hey")
So if the if is true hey wont print

heavy marsh
#

array = no loneger an object

#
    const emojiList = message.guild.emojis.array();
    let emojis = emojiList.slice(0, 10);
``` = v11
#

Bu i cant get it to work on v12

modest maple
#

@narrow kettle that isnt how break works

#

break doesnt affect if statements

earnest phoenix
#

it's a collection, which extends a map

modest maple
#

AT ALL

narrow kettle
#

so how can i make it break out of the loop

#

just say x = 5?

royal portal
#

I still can't do the idle

modest maple
#

no

royal portal
#

I can't make my bot idle for 24/7

modest maple
#

you cant just set a generator object to the value want

#

break breaks the loop

unique nimbus
#

@modest maple They are in a for loop

narrow kettle
#

so the break i wrote will break the loop?

modest maple
#

ik

#

yes

#

break will do just that

#

break the loop

narrow kettle
#

weird

unique nimbus
#

yes

modest maple
#

by any chance

unique nimbus
#

break() will break the loop

narrow kettle
#

either it does not work in my main code or im just retarted

modest maple
#

can i just say

unique nimbus
#

try 1,5

modest maple
#

is it ment to put

unique nimbus
#

I am bad at coding but yeet

modest maple
#

"hey" every iteration

narrow kettle
#

just for the example yes

#

but it should stop at 3

modest maple
#

so it does exactly what it should do? xD

narrow kettle
#

in here

modest maple
#

bearing in mind indexing starts at 0

#

so it will loop through 3 times

narrow kettle
#

in my main code it does not work for some reason

modest maple
#

then on the 4th break

#

what is your full loop

#

full code*

narrow kettle
#

how do i show the code in python again? was it like
'''p
break
'''

#

nope i have no idea

modest maple
#

```py

#
for i in range(5):
  print("pew")```
narrow kettle
#
def show_hidden_word(secret_word, old_letter_guessed):
  secret_list = list(secret_word)
  for x in range(len(secret_list)):
    for y in range(len(old_letter_guessed)):
      if(secret_list[x] == old_letter_guessed[y]):
        secret_list[x] = old_letter_guessed[y]
        break
      else:
        secret_list[x] = '_'

  print("".join(secret_list))
#

so

#

this function is suppose to be a hangman kinda

modest maple
#

that is very different from your example xD

narrow kettle
#

yeah yeah i just needed to know about the break thing :>

#

seceret word is a string of the word they need to guess and old letters guessed is a list of the letters they guessed

modest maple
#

can i ask why you havent just do in old_letter_guessed

molten spade
#

Anyone here good a discord.js?

modest maple
#

instead of getting indexes

heavy marsh
#
    const emojiList = message.guild.emojis.cache;
    let emojis = emojiList.slice(0, 10);
    if (emojis.length < 1) emojis = [`\u200b`];

Error:

(node:12) UnhandledPromiseRejectionWarning: TypeError: emojiList.slice is not a function
narrow kettle
#

basicly if secret_word = owo and old_letter_guessed = [o, i] so it needs to print o _ o

modest maple
#

yh?

narrow kettle
#

i mean 'o _ o'

modest maple
#

so you could just not have the indexing

narrow kettle
#

wym?

modest maple
#

one sec

#
my_list = [1, 2, 3]

for i in range(len(my_list)):
  print(my_list[i])

>>> 1
>>> 2
>>> 3

# The above is just the same as doing
for item in my_list:
  print(item)
>>> 1
>>> 2
>>> 3```
narrow kettle
#

one sec lemem see it

#

eh

#

i think i understood it? its just my first time seing it since im still learning python

modest maple
#

hmm

#

okay then dm bot

narrow kettle
#

but how will it change it?

#

is it just for the look?

modest maple
#

well y is litterally just getting indexes

#

so you can just yeet all of thaty

#

and just get each item in the list

#

btw

#

i really wouldnt advise going into bot making without knowing the basics fully

#

its not a simple thing to get into

narrow kettle
#

ik im not even thinking about making some real bot

#

im just doing some stupid stuff like that so i can slowly learn

#

and maybe have some bot at the end

modest maple
#

sec

#
def show_hidden_word(secret_word, old_letter_guessed):
  secret_list = list(secret_word)
  for x in range(len(secret_list)):
    """We can remove the range and len stuff because we dont need the indexs just to                get the items, this can be just doing like bellow"""
    for letter in old_letter_guessed:  
      if secret_list[x] == letter:  # these brackets were completely redundant
        """Once we have compared the item in secret list to our letter """
        secret_list[x] = letter # we've just simplifed everything much more 
        break  # This only breaks the inner most loop btw
      else:
        secret_list[x] = '_'

  print("".join(secret_list))
#

@narrow kettle ive tried to do the example of how you can remove range(len()) and just use in list

narrow kettle
#

mhm

#

Thanks :>

storm bluff
topaz fjord
#

did you ever print out args.slice(1).join(" ") to see what it is

#

also you're looking in the cache and they're probably a chance that the channel isn't in the cache

storm bluff
#

i fix it

#

let channel = menc(args.slice(1).join(" "));

jovial nexus
sudden geyser
#

do you get an error?

#

where do you define all that stuff

jovial nexus
#

im trying to do a music bot but when i put the command it does nothinf

pale vessel
#

then you shouldn't make a music bot yet

earnest phoenix
#
module.exports = {
    getMember: function(message, toFind = '') {
        toFind = toFind.toLowerCase();

        let target = message.guild.members.cache.get(toFind);

        if (!target && message.mentions.members)
            target = message.mentions.members.first();

        if (!target && toFind) {
            target = message.guild.members.find(member => {
                return member.displayName.toLowerCase().includes(toFind) ||
                member.user.tag.toLowerCase().includes(toFind)
            });
        }

        if (!target)
            target = message.member;

        return target;
    },

    formatDate: function(date) {
        return new Int1.DateTimeFormat('en-US').format(date);
    }
}```

functions.js
#
const { getMember, formatDate } = require("../../functions.js");
const { MemberEmbed } = require("discord.js");
const { stripIndents } = require("common-tags");

module.exports = {
    name: "whois",
    aliases: ["userinfo", "user", "who"],
    category: "info",
    description: "Returns user information",
    usage: "[username | id, | mention]",
    run: async (client, message, args) => {
        const member = getMember(message, args.join(" "));

        // Member variables
        const joined = formatDate(member, joinedAt);
        const role = member.roles
            .filter(r => r.id !== message.guild.id)
            .map(r => r)
            .join(", ") || "none";

        // User variables
        const created = formatDate(member.user.createdAt);

        const embed = new MemberEmbed()
            .setFooter(member.displayName, member.user.displayAvatarURL())
            .setThumbnail(member.user.displayAvatarURL())

            .addField('Member information', stripIndents`**> Display name:** ${member.displayName}
            **> Joined at:** ${joined}
            **> Roles:** ${roles}`, true)

            .addField('User information', stripIndents`**> ID:** ${member.user.id}
            **> Username:** ${member.user.username}
            **> Discord Tag:** ${member.user.tag}
            **> Created at:** ${created}`, true)

            .setTimestamp()

        if (member.user.presence.game)
            embed.addField('Currently playing', `**> Name:** ${member.user.presence.game.name}`);

        message.channel.send(embed);
    }
}```

whois.js
#

how do i change it then

#

read the docs

#

they make no sense

#

yes they do, it's your lack of language knowledge that's the problem here because you don't know js

#

its the fact how i dont bloody understand the sections

#

??

#

what sections lol

#

the docs are 90% mappings of methods, properties and events

#

those aren't sections

#

it's a list of objects that are implemented in the library

#

thanks for the help

shadow shale
#

hello me and my friend have a problem

heavy marsh
#
    const emojiList = message.guild.emojis.cache;
    let emojis = emojiList.slice(0, 10);
    if (emojis.length < 1) emojis = [`\u200b`];

Error:

(node:12) UnhandledPromiseRejectionWarning: TypeError: emojiList.slice is not a function

I am trying to get 10 emojis from the guild in discord.js version 12.0.2

earnest phoenix
#

you're attempting to call slice on a collection

#

call the array method on the collection and then you can use slice

heavy marsh
#

But array is not a functions

earnest phoenix
#

on a collection, yes it is

heavy marsh
#
 const emojiList = message.guild.emojis.cache.array();
earnest phoenix
#

yeah

heavy marsh
#

likrthis?

shadow shale
#

me and my friend have an error


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 790, in invoke
    await self.prepare(ctx)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 751, in prepare
    await self._parse_arguments(ctx)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 670, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 526, in transform
    return await self.do_conversion(ctx, converter, argument, param)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 479, in do_conversion
    return await self._actual_conversion(ctx, converter, argument, param)
  File "C:\Users\lol\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\ext\commands\core.py", line 450, in _actual_conversion
    raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc
discord.ext.commands.errors.BadArgument: Converting to "int" failed for parameter "amount".```
#

thats the code

#

leanguage: python

cursive dagger
#

Somebody is trying to type in "all" instead of a number

shadow shale
#

no

#

thats for economy

#

like

#

-deposit all

#

it worked normally but in embed it doesnt want to work

earnest phoenix
#

use your brain for a moment

shadow shale
#

i tried with my friend

earnest phoenix
#

you're asking for an int as a parameter

#

but then later you want it to be a string, specifically all, which isn't an int

heavy marsh
#
let owner = await bot.fetchUser(message.guild.ownerID); = v11
let owner = await bot.fetch.User(message.guild.ownerID); = v12
#

Is this correct?

earnest phoenix
lean coral
#

@shadow shale (might know now)

shadow shale
#

ok

storm bluff
#
      news.guilds.channels.cache.get(server.voicechannel.channel).setName(server.voicechannel.message.replace("[voicecount]"
                  ^
TypeError: Cannot read property 'channels' of undefined
at Timeout._onTimeout (/app/luffy.js:258:19)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)```
#

what's problem

earnest phoenix
#

have you tried reading the error

mossy vine
#

news.guilds is undefined

sterile minnow
#

guilds is not declared

storm bluff
summer torrent
#

guild

earnest phoenix
#

and if you go browse the docs, which you should have done in the first place, you can see that there is no property named guilds

storm bluff
#

fixed thanks

jovial nexus
#

How can i do that when someone adds the bot to his server the bot send to that peson a message to dm

earnest phoenix
#

you usually don't want to send dms unless the user specifically triggered it via a command

jovial nexus
#

(im new on this)

earnest phoenix
#

but anyways

#

which lib are you using

jovial nexus
#

js

earnest phoenix
#

but

#

which

#

library

jovial nexus
#

discord.js

slender thistle
#

Most of the time it's safe to assume d.js

late hill
#

You don't really know who added the bot

#

So sending a message to that specific person won't be easy

jovial nexus
#

i would like to my bot to say thanks for adding me to the server or something like that

earnest phoenix
#

You don't really know who added the bot
@late hill fyi, you do, with the recent additions with new audit log types and events

late hill
#

ah

sweet rover
#

how do i log in using my account

earnest phoenix
#

you don't

sweet rover
#

yes

late hill
#

but isn't that still kind of a stinky way to do it

earnest phoenix
#

stinky, but it works

sweet rover
#

no

late hill
#

I've personally noticed that the audit logs don't seem to always be that fast

sweet rover
#

wait

late hill
#

As in, I'll receive an event for something but it's not in the audit logs yet

earnest phoenix
#

they used to be slow, like extremely slow (up to a minute for an action to register) but that's been patched a long time ago

sweet rover
#

how do i login using my bot

earnest phoenix
#

i usually wait for 300-400ms to let the action register before fetching the audit logs, wesley

#

which library are you using, thisguysteve?

sweet rover
earnest phoenix
storm bluff
#

i want to make if owner or anyone delele voiceoline channel
delete channel id from data

  let server = guilds.get(channel.guild.id)  
  if (server.voicechannel.channel)
     guilds.delete(server.voicechannel.channel)
})```
heavy marsh
#
    embed.attachFile({ attachment: canvas.toBuffer(), name: 'thumb.png' });
    embed.setThumbnail('attachment://thumb.png');

How to send in the attachment in an embed?

#

in v12.0.2

snow urchin
#
          let vc = message.member.voiceChannel;
          if (!vc) return message.react("โŒ");
          vc.join().then(connection => {
            const broadcast = client.createVoiceBroadcast();
            const stream = "https://radio.expressradio.co/radio/8000/radio.mp3";
            broadcast.play(stream);
            connection.playBroadcast(broadcast, {
              bitrate: 96000,
              volume: 0.1
            });
            message.react("โœ…");
          });

bot joins the vc, and appears as if its playing audio, but no audio is coming through the bot, what did I do wrong?

#

discord.js v11.6.2

shadow shale
#

volume i think

#

@snow urchin

snow urchin
#

nah it aint that

shadow shale
#

then idk

#

Code:

@commands.command(name="deposit", aliases = ["dep"])
    async def _deposit(self, ctx, amount = ""):
        e = discord.Embed(color= 0x8B0000)
        e.set_author(name=f"{ctx.author}", icon_url=ctx.author.avatar_url)
        if amount == "":
            e.add_field(name="Deposit failed:", value="You need to specify the amount you want to deposit", inline=False)
        base_dir = os.path.dirname(os.path.abspath(__file__))
        db_path = os.path.join(base_dir, "Economy data/economy.sqlite")
        db = sqlite3.connect(db_path)
        cursor = db.cursor()
        cursor.execute(f"SELECT bank FROM users WHERE user_id = {ctx.author.id}")
        bank = cursor.fetchone()
        cursor.execute(f"SELECT wallet FROM users WHERE user_id = {ctx.author.id}")
        wallet = cursor.fetchone()
        if wallet is None or int(wallet[0]) == 0:
            return await ctx.send("Can't deposit emptiness (your wallet is empty)")
        elif str(amount).lower() == "all":
            sql = ("UPDATE users SET bank = ?, wallet = ? WHERE user_id = ?")
            values = (int(bank[0]) + int(wallet[0]), 0, ctx.author.id)
        if str(amount) != "all" and int(amount) > int(wallet[0]):
            e.add_field(name="Deposit failed:", value="You don't have enough money in your wallet to deposit", inline= False)
        elif wallet is not None or int(wallet[0]) != 0 and str(amount).lower() != "all":
            sql = ("UPDATE users SET bank = ?, wallet = ? WHERE user_id = ?")
            values = (int(bank[0]) + int(amount), int(wallet[0]) - int(amount), ctx.author.id)
        await ctx.send(embed = e)
        cursor.execute(sql, values)
        db.commit()
        cursor.close()
        db.close()```

input: !deposit all
output:  
```File "c:\mydir\mydir\mydir\cogs\economy.py", line 131, in _deposit
    values = (int(bank[0]) + int(amount), int(wallet[0]) - int(amount), ctx.author.id)
ValueError: invalid literal for int() with base 10: 'all'```
#

python

earnest phoenix
#

something's wrong with your if checks

shadow shale
#

wow ik

earnest phoenix
#

then go over them and debug lol?

grizzled raven
#

check if its undefined

#

bank[0] or wallet[0]

#

not undefined lol this is py

#

None?

shadow shale
#

allready fixed

grizzled raven
#

ok

tight heath
#

I couldn't have thought of a more rude way to respond to help

modest maple
#

we'll ignore the fact

#

that the code itself is awful

narrow kettle
#

can i ask in this channel about coding questions that are not about bots?

slender thistle
#

Yup

modest maple
#

sure

narrow kettle
#

ok so [Python], I need to make a function that gets two tuples and makes every couple possible with them(Im pretty sure i didnt explain it well so im sending an example)

#

like i have an idea in my mind but im note quite sure about how to do it with tuples?

modest maple
#

tuples can just be referenced like any other iterable object

#

if you think of it like expanding brackets

#

start with the first item in the first tuple

#

make all the possible combinations with just the first item in tuple 1 and tuple 2

#

then go to seconds element

narrow kettle
#

can i just say print(first_tuple[0], second_tumple[0] but run it in a loop?

#

and 0 would be x and y

modest maple
#

well that example is adding all the tuples its made to one tuple and printing that

narrow kettle
#

oh

#

Thanks, Hopefully i can do it :>

modest maple
#

You'll want some nested iteration

#

e.g

#

for x in y:
for z in q:
magix

split hazel
#

Strange question but is there a library out there that, basically has the same prototype as PHP, but instead of PHP scripts, you write PHP scripts in javascript

#

Not looking for something like EJS

quartz kindle
#

how would that even work? considering php scripts spawn a new thread for every connection while js answers all connections in the same thread

#

or are you looking for some kind of js > php transpiler?

heavy marsh
#
embed.addField("Discord API Latency", `\`${Math.round(bot.ping)} ms\``);
#

It shows as nun

#

nul

prime cliff
#

nun

heavy marsh
#

yep

amber fractal
#

@heavy marsh what's your d.js version

restive furnace
#

you mean nAn?

amber fractal
#

they mean null

#

I'm guessing

#

wait

#

no

#

it'd be NaN

restive furnace
#

btw if v12 its <client>.ws.ping

heavy marsh
#

mine is 12.0.2

restive furnace
#

ok

#

then it is that

#

client#ws.ping

heavy marsh
#

It will give the discord API Latency right?

restive furnace
#

yes

amber fractal
#

it gives you the ping of the websocket connection

summer torrent
#

client.ws.ping

cunning glen
#

can confirm bot faster?

restive furnace
#

no

cunning glen
#

why not

amber fractal
#

because there's a queue

cunning glen
#

l'm waiting 2 weeks

#

I'm tired now

restive furnace
#

Tip: If you're tired, you should sleep.

cunning glen
#
  • I am tired of waiting ๐Ÿ’ฉ
earnest phoenix
#

what does it mean by Invalid server format when I'm adding a new bot

#

@fossil oxide what does it mean by Invalid server format when I'm adding a new bot

daring garden
#

How do I shard a bot across multiple physical servers? i.e. not multiple instances on one server

earnest phoenix
#

in which library

#

@bitter sundial what does it mean by Invalid server format when I'm adding a new bot

#

baby yoda, stop being annoying and pinging mods

#

it means what it means, you've provided the wrong format

#

but I need help

bitter sundial
#

the servers this bot is in section is formatted incorrectly

daring garden
#

discordjs

bitter sundial
#

it needs to be server ids separated by commas like so
1234, 5678

#

it's optional so you can also leave it empty

earnest phoenix
#

pass the shard ID to run on, itsjake

#

finally finished my bot

daring garden
#

aha, I see. I was trying to find info in the guides but there wasn't much there. I'll check that out, thanks!

low bolt
#

Which database is best for saving some player datas?

#

(Currently, i'm using quick.db)

#

And I'm not happy with this database module

earnest phoenix
#

(m => m.delete(5000));

does that exist in v12

#

it doesnt work

amber fractal
narrow kettle
#

cry i just want to say thats one of the best videos that exist

earnest phoenix
#

hello, how i can do stats command with top.gg stats of my bot?

#

what

#

yes

#

is @tight osprey

earnest phoenix
#

lol

heavy marsh
#
    loadImage('./images/PYSBump.png').then(bg => {
        const canvas = createCanvas(bg.width, bg.height);
        const ctx = canvas.getContext('2d');
        
        loadImage(user.displayAvatarURL().split('?')[0] + '?size=2048').then(avatar => {
            ctx.drawImage(avatar, 0, 0, canvas.width, canvas.height);
            ctx.globalCompositeOperation = 'destination-in';
            ctx.drawImage(bg, 0, 0);
            
            const embed = new discord.MessageEmbed()
                
                embed.attachFiles({ attachment: canvas.toBuffer(), name: 'avatar.png' });
                embed.setDescription(`**Avatar For ${user.tag}**`);
                embed.setImage('attachment://avatar.png');

Error:

(node:12) UnhandledPromiseRejectionWarning: Error: Unsupported image type

Discord.js v12

earnest phoenix
#

can you pass me a code or something, i dont entend

summer torrent
#

what is loadImage?

#

is that jimp?

earnest phoenix
#

for what is that code

summer torrent
#

or canvas

heavy marsh
#
const { createCanvas, loadImage } = require('canvas');
earnest phoenix
#

for what is it?

summer torrent
#

displayAvatarURL() returning as .webp

heavy marsh
#

ooh

summer torrent
#

try displayAvatarURL({format:"png"})

heavy marsh
earnest phoenix
#

how i can do it?

earnest phoenix
summer torrent
#

also you dont need to add .split('?')[0] + '?size=2048'. URL is a function.

#

@heavy marsh

earnest phoenix
#

:/

heavy marsh
#

ooh

summer torrent
#
displayAvatarURL({format:"png", size:2048})```
heavy marsh
#

Do I have to have a size ...

#

Let me see with out a size

#

Oof the quality is bad

sharp solstice
#

Is it possible to pay for montly advertise?

summer torrent
quartz kindle
#

^404 ?

sharp solstice
#

ERROR

summer torrent
#

ah wait

earnest phoenix
#

lol

summer torrent
digital ibex
#

Hi

earnest phoenix
#

how i can use canvas?

digital ibex
#

button {
    text-decoration: none;
    padding: 9px;
    background-color: aliceblue;
    border-radius: 8px;
}``` I have text decoration on none, but it still shows the blue lines on hyperlinks
#

Anyone know how i can remove the blue lines underneath?

tight plinth
#

Blue lines on hyperlinks? I've never seen a way to remove it

#

Maybe there is

digital ibex
#

these

#

it shows blue lines underneath

tight plinth
#

One way to get around this is to make the buttons clickable, not the text

digital ibex
#

how would i do that?

tight plinth
#

I'm a shit at html/CSS, can't helm

slender thistle
#

element:hover {text-transform: none;}

digital ibex
#

okie

#

thank you

slender thistle
#

Or so I recall

digital ibex
#

nope

#

its not that

narrow kettle
#

[Python] hey, so i need to make a function that gets a string and returns it as a dict but in the dict is the key which is the letters in the string(space not included) and their value is the times they are in the string, example:

royal portal
#

How do you use setPresence on discord.js?

narrow kettle
#

im not sure where i need to start from but i know i need to check with count(While its a string) how many times each charcter appears and then bind it to the key, but im not sure how i bind it to the key and where do i start from?

slender thistle
narrow kettle
#

right, but how do i bind it to a key?

slender thistle
#

Iterate over the string
check if character is in a dict already:
if not, add the char as key and string.count(char)
else skip

royal portal
#

Anyone know how to use setPresence on discord.js

digital ibex
#

@royal portal yes

narrow kettle
#

mhm

slender thistle
#

Have you tried reading the docs

digital ibex
#

its an object so