#development

1 messages Β· Page 1298 of 1

opal plank
#

End user data

solemn leaf
#

ok

#

I can easily delete it

opal plank
#

You arent allowed to store it nor share it

solemn latch
#

im in a server named dbl

#

gottem

solemn leaf
#

WOoo stop breaking the law

opal plank
#

Reported @solemn latch

earnest phoenix
#

And in your code, disableEveryone: true should be disableMentions: "everyone"

solemn leaf
#

?

#

wait

#

Imma test that

solemn latch
#

I need to disable everyone

#

havent because i would need to actually do stuff

#

and that sounds like work

solemn leaf
#

FFF

#

It does

#

LOL

opal plank
#

I disabled it lmao

#

Does here count as everyone?

#

I assume it does

#

In d. Js at least

earnest phoenix
#

I think so

opal plank
#

Feels bad, in a party and im replying in #development rather than going around lmao. #devLife

solemn leaf
#

How do I disable it?

#

pinging anyone is a command

opal plank
#

When u make ur client

solemn leaf
#

ah I see

opal plank
#

There are optional options u can initiate it with

solemn latch
#

lmao

solemn leaf
#

alright thanks

opal plank
#

Someone throw em the docs on Client pls

solemn leaf
#

imma got to bed and finish the legend of going to bed at a reasonable hour

opal plank
#

@solemn latch ty

solemn leaf
#

I cant read these docs

#

sorry

opal plank
#

Wdym?

fluid basin
#

Does here count as everyone?
yeah according to dapi docs its @here and @everyone

opal plank
solemn leaf
#

what is shard

opal plank
#

Huh?

#

Wdym thats shard?

solemn leaf
#

bot.shard

opal plank
#

Huh???

fluid basin
#

discord development is like playing a game

#

shard is for more advanced users

solemn leaf
#

.shard

Shard helpers for the client (only if the process was spawned from a ShardingManager)
Type: ?ShardClientUtil

fluid basin
#

it is not recommended to start using it unless you are getting close to around 1k servers

solemn leaf
#

LOL

fluid basin
#

tl;dr come back when you have 1k servers that your bot is in

opal plank
#

@fluid basin discord development is like playing a game, BUT the floor is on fire, the walls are errors and the compiler works 30% of the time

solemn leaf
#

and random sprites glitch

#

ok time to finish the legend of going to bed at a reasonable hour

#

gn

fluid basin
#

tbh sharding at 1k isn't considered late at all

solemn leaf
#

what even is sharding

opal plank
#

Just gonna flex that im doing my own cluster

fluid basin
#

1 glass, you drop it, it breaks into shards

#

so basically

#

its breaking up your bot into multiple smaller ones (with the same functionality)

solemn leaf
#

for performance

#

?

fluid basin
#

well yes

solemn leaf
#

ok imma wait until im in 500 servers

#

peace

fluid basin
#

but the most important one is for discord to balance messages that your bot get

solemn leaf
#

ok

#

this correct for dming a user?

opal plank
#

Its basically splitting X amount of channels to be processed by a core

solemn leaf
#
message.author.send(`I'm Missing IMPORTANT permissions to send messages: ["SEND_MESSAGES", "VIEW_CHANNEL", "EMBED_LINKS", "ATTACH_FILES"]. In ${message.guild.name}`)
opal plank
#

Rather thsn have ALL of them onto the same channel

solemn latch
#

well, some bots shard on the same thread.

opal plank
#

Isnt the whole point of sharding splitting work between threads so it doesnt clutter just one?

solemn latch
#

i thought so

opal plank
#

Then why do it all on one core?

solemn latch
#

but dank memer has like 8 shards per core

#

πŸ€·β€β™‚οΈ

opal plank
#

Sounds off but must me my lack of knowledge

solemn leaf
#

how can I test if the bot can send messages to the user

fluid basin
#

you can't

solemn leaf
#

can I catch the error

fluid basin
#

either it sends

#

or it doesn't

#

yes please catch the error

solemn leaf
#

how

fluid basin
#

try/catch + await

solemn leaf
#

await message.author.send().catch()

opal plank
#

^^

earnest phoenix
#

so when i do html <style> body { background-color: #696969; } </style>on my bot page, nothing happens, tryna set a background color and i think i may have done it wrong 😳

solemn leaf
#

why 696969

fluid basin
#

you need to override the default css

#

why not

solemn leaf
#

what color is that

fluid basin
#

why not

earnest phoenix
#

"why 696969" smirk

solemn latch
earnest phoenix
#

you need to override the default css
@fluid basin sounds fancy how do i do it

#

what color is that
@solemn leaf light grey iirc

opal plank
#

@solemn latch funfact im doing the same

#

Just re-emitting everything onto main process

fluid basin
#

internal sharding is great but dumb

faint prism
#

I've never used dank memer, and honestly have no idea what people are talking about when they refer to it's functionality

#

My text-to-speech got butchered there

opal plank
#

Im fairly certain the way im doing is not the most optimal but really decent

earnest phoenix
#

so just html <style> body { background-color: #696969 !important; } </style> ?

fluid basin
#

yup

earnest phoenix
#

shittt

#

it didnt do anything lmao

fluid basin
#

you'll need to explore then

#

there might be a few background-* stuff on the site

#

you need to make sure you remove and overwrite all of them

solemn latch
#

πŸ€·β€β™‚οΈ internal sharding sounds great. problem is my bot likes to destroy the cpu so internal would never make sense.

earnest phoenix
#

oh shit wait

#

i got it

fluid basin
#

yeah lmao internal sharding is dumb unless you have a beefy cpu with great single core perf

opal plank
#

@solemn latch well thats rhe point

#

Using every single thread

fluid basin
#

also if you really want to scale your bot

solemn latch
#

thats the thing tho, internal sharding uses 1 core per group

opal plank
#

Should be using it on a good vps

fluid basin
#

make sure cpu-bound tasks are not within the bot process

opal plank
#

Or good cpu, at least

solemn latch
#

so internal makes no sense

fluid basin
#

not internal sharding woo

#

nodejs only uses 1 core/1 thread for cpu-bound tasks

#

which is also the main thread

#

nodejs spawns threads only for IO-bound tasks

#

libuv balances it

earnest phoenix
#

wtf lmao

fluid basin
#

and kinda "creates" a queue

#

and execute all your code on the main thread

sudden geyser
#

press on your name in the top right

#

then settings or somethikng

solemn latch
#

IO including http?

fluid basin
#

while those waiting will take up the worker threads

opal plank
#

Just looked, without knowing i did something similar to d.js lmao

fluid basin
#

yes IO include disk reading (NOT sync ofc), networking (sockets + http + whatever)

#

IO => input/output

#

data basically

#

all code/logic runs on the main thread

solemn latch
#

ive not seriously loaded my bot down yet, i wonder if its not as bad as it looks

#

because http loads have been maxing my cpu out if theres more than 4 at a time

clever beacon
#

I have a small question related to setting up webhook stuff (not asking in #topgg-api because it's not directly related to the DBL API)
basically, I'm trying to use the aiohttp Python module (feel free to shun for for using discord.py) to set up a small web server thing for handling DBL votes
however, upon loading the DBL cog, aiohttp doesn't actually run async and prevents the bot from starting... what should I do?
also, code snippet:

        self.app = web.Application()
        self.app.add_routes([web.post("/dblwebhook", self.handleDBLVote)])
        web.run_app(self.app, port=10215)```
opal plank
#

What im doing is dynamically spawning them as needed with a variable and adding them as needed

#

If your channnel count is bigger than 500 channels per 'shard' it spawns more as needed

#

They redirect onto client

#

So you dont notice a difference

fluid basin
#

main thread: hey we have an async line that does http request
main thread: creates network connection and throws to worker thread to await the network response
main thread: meanwhile lets work on the following lines after that async
worker thread: I'm ready! slots the response back into the internal queue in nodejs
main thread: OH the worker is ready, lets process that (e.g. json parse etc whatever)
main thread: ok we're done, lets continue where we left off (from the queue)

#

this basically how nodeJS works

lucid prawn
#

heyyy can someone help me with my code

solemn latch
#

not without more info

fluid basin
lucid prawn
#

heyyy can someone help me with my code

fluid basin
#

@clever beacon you need an async context to make it run async afaik, and usually inside of a thread

solemn latch
#

a band?

fluid basin
#

if you just do <app>.run_app it will block

lucid prawn
#

can someone help me

clever beacon
#

actually that would make sense now considering it’s in __init__

#

which isn’t async

solemn latch
#

no, you are not giving enough info for us to help @lucid prawn

fluid basin
#

yeah your best option is to start a thread @clever beacon

clever beacon
#

ensure_future or smth

lucid prawn
#

can someone help me with my code const Discord = require('discord.js');

const client = new Discord.Client();

client.once('ready', () => {
console.log('chill bot 2 is online');
});

client.login('NzYyODU3NTEwMTAwNzk1NDAy.X3vQaw.RnbuyZuzlMLwhiZPm0H_HSkP_bE');

opal plank
#

@lucid prawn refresh token

solemn latch
#

kek

opal plank
#

And delete that shit

solemn latch
#

did you just get a link from discord @lucid prawn

lucid prawn
#

no

clever beacon
#

discord should auto-refresh your token once it figures out that you just leaked it

#

and you should get an email

solemn latch
#

github does

clever beacon
#

but delete that and refresh your token

solemn latch
#

for discord

#

i just posted it on gethub to refresh it automagically

lucid prawn
#

ok

solemn latch
#

πŸ€·β€β™‚οΈ

lucid prawn
#

so can u help me

solemn latch
#

whatcha need help with

#

πŸ€”

lucid prawn
#

code

solemn latch
#

okay but what

#

your not asking a question

lucid prawn
#

what do i do when i type node . it just popup black

fluid basin
#

so you either use the bot's loop to "async" it

#

or you create the server and add the bot into its "async" loop

earnest phoenix
#

how do i change the buttons background color on my bot page, what do i use? html <style> body { button-color: #696969 !important; } </style> not sure what to do

fluid basin
#

find the responsible class/tags of the button, then change those

#

it is recommended to learn css/html if you don't have prior knowledge on that

earnest phoenix
#

where can i find those

fluid basin
#

inspect element

earnest phoenix
#

oh shit

#

ok then lmao thanks

fluid basin
#

it is recommended to learn css/html if you don't have prior knowledge on that
mainly css actually

#

you need to know accessors (class, id, element) and attributes

#

button-color is not a css attribute

empty hollow
#

Do you know a better cloud than heroku?

solemn latch
#

any vps

empty hollow
#

thanks

earnest phoenix
#

How to Give a bot command to randomly generate work

#

**rask

#

Task

#

Like If I have many options like
What is your age? Your name? Your favoirite bot? And the bot will type it randomly

solemn latch
#

have an array, get a random number between 0 and the number of elements - 1 and thats your output

#

age can be the random number

earnest phoenix
#

No

#

The bot must ask these questions

solemn latch
#

oh?

#

so what needs to be random?

earnest phoenix
#

Just like a conversation bot that talks

solemn latch
#

chat bot?

earnest phoenix
#

Yes You can say

solemn latch
#

then id suggest using amazons leo api

#

think its called leo

earnest phoenix
#

@solemn latch how to use it I am a noobie so I dont know πŸ˜…πŸ˜”

solemn latch
#

never used it, not sure

#

oop its called lex

earnest phoenix
#

@solemn latch its paid

#

I want free

solemn latch
#

sure, bots cost money anyway πŸ€·β€β™‚οΈ

#

comes with 10k messages free

earnest phoenix
#

Not at all

#

I want truly free

solemn latch
#

chatbots are typically extremely expensive to research if they are anything more than randomized lines

#

which is what i suggested before that you denied

thick gull
#

Β―_(ツ)_/Β―

opal plank
#

Just slap a Learning AI onto your messages

#

Ggez

thick gull
#

i want to learn neural networks for this sole purpose but i don’t think discord would be too happy

earnest phoenix
#

Isn't there any code to generate?

solemn latch
#

yeah, if you are a pro

earnest phoenix
#

Random words

#

@solemn latch can you tell me a Sample

#

Guys I tried RR not commands it didn't Respond

solemn latch
#

i told you how to choose random lines...

earnest phoenix
#

@solemn latch can you please type again

solemn latch
#

its still there

#

scroll up

earnest phoenix
#

How do I Make Reaction roles respond I tried the commands it didn't Resond

clever beacon
#

welp, I'm a little bit lost
I'm trying to open my AWS instance's ports so they can be POSTed to via DBL webhooks, however I must have done something wrong here
I have my instance's security group set up here to open port [redacted, no DDOS for you], but when I try to post to it, I get connection refused (indicating that the port isn't open)

#

and yes, the security group is associated with the instance

solemn latch
#

is anything on that port when your posting?

#

iirc, ports are still considered closed if nothings on the other side.

earnest phoenix
#

@solemn latch I have tried but he is getting fed

clever beacon
#

i haven't pulled changes yet but it should just be a 404 or something, not a full connection refused

earnest phoenix
#

He is replying many times

solemn latch
#

404 only happens if you have a webserver up right?

clever beacon
#

it happened earlier when I was testing locally and had my port set incorrectly on my webserver

#

it gave a 404

#

actually

#

i could be wrong

solemn latch
#

psh i could be wrong too

clever beacon
#

lemme try again with cURL

earnest phoenix
#

How can I make my bot to randomly generate a no from 1 to 200. Can you type the code?

clever beacon
#

huh okay I think you're right actually Woo

#

i'll try pulling changes to my instance

#

the reason I got a 404 earlier was because the webserver was running but I wasn't going to the endpoint

#

and I don't have an endpoint on root

solemn latch
#

idk what programming language your using, cant really help @earnest phoenix

earnest phoenix
#

@solemn latch java

sonic lodge
#

Math.random()

#

it'll generate a random double from 0 to 1

solemn latch
#

java and javascripts random number generation is the same?

sonic lodge
#

yee

solemn latch
#

weird

#

well not really

#

what else would it be.

earnest phoenix
#

Math.random()
@sonic lodge I want from 0 to 200

sudden geyser
#

no Java has the Random class

solemn latch
#

then multiply it by 200 πŸ€”

sonic lodge
#

oh yeah, math.random() is just one way

earnest phoenix
#

@solemn latch how?

#

@sonic lodge code please I am a noob

sonic lodge
#

Math.random() * 200

solemn latch
#

this isnt a teaching server btw

sonic lodge
#

nor a spoonfeeding server

earnest phoenix
#

@sonic lodge yeah ok What is math.floor?

solemn latch
#

we are glad to help, we can point you in a direction, but dont expect us to sit here for hours answering every question

earnest phoenix
#

@solemn latch no I am sorry If I asked to much questions

sonic lodge
#

floor -> round to next lowest integer
round -> round to nearest integer
ceil -> round to next highest integer

earnest phoenix
#

@sonic lodge ok

severe timber
#

need help, or should i say need a place to host bot on

#

any suggestions?

solemn latch
#

galaxygate

severe timber
#

does it support py?

solemn latch
#

of course!

#

there are other vps prividers, i suggest shopping around for them

severe timber
#

well for free

solemn latch
#

free servers? not really a good idea imo

hazy sparrow
#

You can get bluefox free version its good for starters

solemn latch
#

if you ask me, storing other users data is a bad idea if you dont trust the provider

#

presuming your doing that of course

earnest phoenix
#

Code to generate random words is word.random legit?

hazy sparrow
solemn latch
#

we dont spoonfeed here, but yes using the method we explained it will work

earnest phoenix
#

@solemn latch I am asking the code like math.randim

#

Random

solemn latch
#

Math.random()

#

thats it

earnest phoenix
#

No

#

Word

#

I have used math

#

Now word

#

Random words from all over the world

hazy sparrow
#

You could put all the words in a array and randomzize the array technically

solemn latch
#

yeah

#

exactly what hes doing

earnest phoenix
#

@hazy sparrow what? Can you explain it

solemn latch
#

just put the words, or sentences you want in an array.

earnest phoenix
#

With an example

solemn latch
#

we dont spoonfeed here man

hazy sparrow
#

this is not a spoonfeed server

earnest phoenix
#

What is an array? { ? Or (?

hazy sparrow
#

wowie

earnest phoenix
#

Thanks

#

πŸ˜‚

solemn latch
#

["first thing","second thing"]

earnest phoenix
#

Oh thanks

#

@earnest phoenix It's super easy to generate random numbers within a range in JavaScript using METH i mean math

#

Umm am I supposed to write math.random or anything else

hazy sparrow
#

yes

earnest phoenix
#

What?

#

Math.random?

hazy sparrow
#

Math.random()

earnest phoenix
#

Ok thanks brother

#

if you multiply the number Math.random() gives with your max value it will NEVER be bigger than that because 1 * anything is always the number and Math.random() only generates numbers between 0 to 1 (decimals)

#

@earnest phoenix I dont want numbers I want random words

#

you can get random indexes from an array

solemn latch
#

you need numbers to get things from an array

hazy sparrow
#

^

opal plank
#

Array has an index

vital lark
#

yes

opal plank
#

As long as that index is within range its fine

#

You can do math.random

ionic dawn
#

list[<index>]

#

and that stuff

opal plank
#

Just make sure its within maximum rage

vital lark
#

you can do arr[Math.floor(Math.random() * arr.length)] to get the random value

earnest phoenix
#

kinda like:

Math.random() // returns a number between 0 and 1
Math.random() * maxValue // will always be smaller than maxValue but never zero
Math.floor(Math.random() * maxValue) // rounds the number upwards so it's a whole number NOT a decimal

try replacing maxValue with the length of the array (array.length)

opal plank
#

Range*

earnest phoenix
#

you can do arr[Math.floor(Math.random() * arr.length)] to get the random value
@vital lark spoonfeed

vital lark
#

it's not huge chunks of code

earnest phoenix
#

smh

vital lark
#

if it's just a line, it's not considered spoon-feeding

earnest phoenix
#

alright then

halcyon shore
#

How are you guys coding here

hazy sparrow
#

pc

earnest phoenix
#

Its showing wrror

halcyon shore
#

Oh

vital lark
#

what is the error

earnest phoenix
#

How are you guys coding here
@halcyon shore how does one code on discord with only bot eval commands and Chrome Dev Tools

solemn latch
#

absolutely is spoon-feeding.
Everything he needed to do it was given to him

hazy sparrow
#

What error @earnest phoenix

vital lark
#

and he failed

#

so lyricShrug

earnest phoenix
#

@hazy sparrow its showing ; is an error

#

@earnest phoenix WHY IS THE PREFIX !

#

aaaaaaaaaaaaaaaaaaaaaaaaaaa

hazy sparrow
#

aaaaaaaaaaa

earnest phoenix
#

over-used as fuck prefix

#

@earnest phoenix because its easy

#

wha-

#

then your bot will clash with 100 other bots

#

because 99.99999% of bots on discord have the same prefix ! and if someone sends !help in a server with a lot of bots they'll get fucked

hazy sparrow
#

That's not how you do it @earnest phoenix

earnest phoenix
#

@earnest phoenix I am not using !help command

#

That's not how you do it @earnest phoenix
@hazy sparrow then?

hazy sparrow
#

put the words you want in a array

#
const array = ["thing1","thing2"]
earnest phoenix
#

@earnest phoenix you can do array[indexNumber] to get the specific value from an array at that index

#

arrays are indexed from 0

#

array[0] returns the first element array[1] returns the seconds element and so on

#

You can pass a random number as the index

hazy sparrow
#

Also why the fuck are you using a seperate event for each command

earnest phoenix
#

@hazy sparrow thanks

#

@earnest phoenix you 100000000000000000% need to learn JavaScript before trying to make a bot

hazy sparrow
#

Yes please do that

earnest phoenix
#

it's a fucking necessity

#

look at my pull request on discordjs.guide

#

i added a bunch of extra links to learn javascript

hazy sparrow
#

Or you could make your own language

earnest phoenix
#

Or you could make your own language
@hazy sparrow that'll need you to learn machine level language first

#

put the words you want in a array
@hazy sparrow its till showing an error

hazy sparrow
#

What error

#

And show the code

earnest phoenix
hazy sparrow
#

Please fucking learn js before making a discord bot

earnest phoenix
#

@hazy sparrow but its showing error

hazy sparrow
#

I-

solemn latch
#

Glitch error messages ahh

#

its like developing on a platform with a ball and chain around your ankles

earnest phoenix
silver lintel
#

Aaaa learn js

solemn latch
earnest phoenix
silver lintel
#

Also @earnest phoenix you dont need to do client.on on every single command

earnest phoenix
#

do you need to create a canvas element to use d3.js or will it automatically create one?

#

@silver lintel ok

#

d3.select("body"); does nothing?

solemn latch
#

selects the body no?

#

;p

earnest phoenix
#
d3.select("body").style("backgroundColor","#FFFFFF");

this ain't working. D3 uses camelCaseWhichJavaScriptUses or dashed-case-which-CSS-uses?

solemn latch
#

the page i linked to
"d3.select("body").style("background-color", "black");"

earnest phoenix
#

πŸ…°οΈ

#

What if I have given my bit 4 words to type randomly and these Words are A,B,C,D but My Bot is Is only Typing D not The others

solemn latch
#

whats your code?

earnest phoenix
#

What if I have given my bit 4 words to type randomly and these Words are A,B,C,D but My Bot is Is only Typing D not The others
@earnest phoenix maybe just a coincidence? send the code please

#

Ok

#

msg.reply(("Nice","Poty","Muut","OP"));

#

we can use element.append() to add an element inside it but how do we remove one?

#

@earnest phoenix PLEASE LEARN ACTUAL FREAKING JAVASCRIPT
checkpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpinscheckpins

#

@earnest phoenix I haven't used this

sonic lodge
#

do you realize what that does

earnest phoenix
#

@earnest phoenix no no

sonic lodge
#

it sees ("Nice","Poty","Muut","OP"), and decides to evaluate the strings inside

earnest phoenix
#

@earnest phoenix no

#

read the pins for why we're screaming

sonic lodge
#

so you clearly have no clue what you are doing

#

and you're refusing to learn even the basics

earnest phoenix
#

can you use IDs in d3.select();

#

why did i randomly put a semi colon at the end of the message waitWhatSpin

hazy sparrow
#

Is there a way for a bot to leave a server without being kicked/banned?

solemn latch
#

guild.leave

fluid basin
#

library?

solemn latch
#

or depending on lib

hazy sparrow
#

D.js

fluid basin
#

Guild#leave

hazy sparrow
#

oki thanks

restive furnace
#

on most libs it's Guild#leave(), that's what I can say

hazy sparrow
#

I wanna make a leave command thats why lmfao

silver lintel
#

@earnest phoenix make an array with the values, and generate randomnum and do array[num]

solemn latch
#

make it say itll make the bot leave, but make it kick the user @hazy sparrow ;p

hazy sparrow
#

LMAO

earnest phoenix
#

@silver lintel ?????????

silver lintel
#

ugh learn javascript

solemn latch
#

these are very basic programming concepts

earnest phoenix
#

yep

silver lintel
#

array[Math.floor(Math.random() * array.length)]

earnest phoenix
#

basic

mild flower
#

how do i make the command stop after .catch(err ) stuff is executed

#

for example im making a nickname command and whenever it catches an error cus it cant change nickname i cant get it to break

#
 nickuser.setNickname(nick).catch(err => {
                if(message.guild.me.hasPermission("ADD_REACTIONS")) message.react('❌')
                message.channel.send(nickerror)})
            message.channel.send(`βœ…Changed ${nickuser}'s nickname to ${nick}`)```
earnest phoenix
#

array[Math.floor(Math.random() * array.length)]
@silver lintel yaar

silver lintel
#

go learn it, you will not be spoon fed

earnest phoenix
#

@silver lintel yaar mene kha kya,

#

?

silver lintel
#

@mild flower return?

earnest phoenix
#

Did I said?

mild flower
#

not working

earnest phoenix
#

That spoonfied me

#

Feed**

silver lintel
#

sstop speaking hindi

mild flower
#

lol

solemn latch
#

wb shiv

slender thistle
#

Google how to create an array and how to get a random element from it @earnest phoenix

earnest phoenix
#

me

#

eeme

solemn latch
#

@mild flower do you mean you dont want the stuff in catch to run? or do you not want things after the error to run?

earnest phoenix
#

@silver lintel how did you know that I am speaking Hindi??? Huh?

mild flower
#

@mild flower do you mean you dont want the stuff in catch to run? or do you not want things after the error to run?
@solemn latch after the error

#

i tried bypassing that with an if statement to check whether the nickname of thet user is same as inputted

#

but doesnt seeem to work

silver lintel
#

@earnest phoenix B)

mild flower
#

i tried this if statement:
if(user.displayname === nickname) return message.channel.send('success')

#

(dont worry about those variables)

solemn latch
#

if your in a function you can just return at the end of catch right?

mild flower
#

not workujnbvdw

#

should i give you hastebin?

#

@solemn latch

solemn latch
#

your other option is use try catch rather than .catch

mild flower
#

ah

#

yes

#

i forgot about that

restive furnace
#

if ur using d.js, User#displayname prop doesn't exists

solemn latch
#

that too

mild flower
#

then what should i use for that

restive furnace
#

use User#nickname instead

mild flower
#

nickname

#

ah ok

solemn latch
#

i just ignored it because he said the vars didnt matter

mild flower
#

well when i try that

#

with user.nickname

#

it doesnt send it ever

tight plinth
#

nicknames are attached to members, not users

mild flower
#

yes i am using a member tag for the var

tight plinth
#

it sends null if the member don't have any nick

mild flower
#

let me try usint try:catch

sand sparrow
#

Can someone join my test server and see if my welcome message works?
You can leave afterwards

earnest phoenix
#

This is my code
client.on("message", msg=> {
if (msg.content === "!character") {
msg.reply ??? What should I type ahead?

solemn latch
#

send it in dm @sand sparrow

sand sparrow
#

Okie

earnest phoenix
#

For random words

mild flower
#

bruh

#

now my try catch is not working

solemn latch
#

@earnest phoenix people gave you copy paste code even tho its against rules πŸ€·β€β™‚οΈ

earnest phoenix
#

@solemn latch no they didn't!

silver lintel
#

if you actually knew js, you would know exactly how to do it

sand sparrow
#

^^

solemn latch
#

I know they did πŸ€”

mild flower
#

hey

#

the try and catch is not working

#

whenever i get an errror

#

it doesnt catch it

#

πŸ€¦β€β™‚οΈ

solemn latch
#

f

mild flower
#
            try {
                nickuser.setNickname(nick)
            }
            catch(err) {
                return message.channel.send(nickerror)
            };```
#

what am i doing wrong

solemn latch
#

its not catching anything?

mild flower
#

yea

solemn latch
#

no clue

earnest phoenix
#

setNickname is a promise

#

anything that does a REST request is a promise

#

you can't make asynchronous code magically work as synchronous

solemn latch
#

o, yeah christmasthink

mild flower
#

uh why this getting greyed out

earnest phoenix
#

you cant return if lol

mild flower
#

ah yes

earnest phoenix
#

if(condition) return x
else return y

slender thistle
#

ternary operator

earnest phoenix
#

it just gets interpreted as if else so it's still not return if mmLul

slender thistle
mild flower
#

i think i got it

amber thistle
#

can anyone give me guides on how to play spotify links for my music bot

earnest phoenix
#

you can't

amber thistle
#

eh?

earnest phoenix
#

you're not allowed to stream from spotify

amber thistle
#

but

solemn latch
#

spotify doesnt have a public music api

#

just the info on songs

mild flower
#

nope stilll getting the error

earnest phoenix
#

no bots stream from spotify before you say they do

mild flower
#

i mean

amber thistle
#

but other bots do accept spotify links

mild flower
#

still getting both outputs

earnest phoenix
#

aaaand there it is

solemn latch
#

they play from youtube mainly

#

just get the info from spotify and search youtube

amber thistle
#

ah

earnest phoenix
#

the bots just scrape the spotify link and then search it on YouTube ^^

#

Any help me

amber thistle
#

so does anyone have docs on how to get the info of a spotify song / playlist

earnest phoenix
#

google it

amber thistle
#

i did

earnest phoenix
#

there's a plethora of guides on how to scrape spotify

amber thistle
#

and it take me to the spotify dev page

#

there's a plethora of guides on how to scrape spotify
can u give me one

solemn latch
#

the spotify docs are really good imo

#

they are plenty good to do it without a guide

amber thistle
#

they said something about ouath and user tokens

earnest phoenix
#

client.on("message", msg=> {
if (msg.content === "!character") {
msg.reply ??? What should I type ahead? For random words?

amber thistle
#

and i have no idea where to get my user token

#

@earnest phoenix u make a array of words and randomise it

#

(thats how i do it)

earnest phoenix
#

@amber thistle how?

slender thistle
#

Did I tell you to Google it yet

earnest phoenix
#

@slender thistle yes

solemn latch
#

we have been telling him the same thing all night,

slender thistle
#

"create an array javascript"
and
"get random element from an array javascript"

solemn latch
#

past 4 hours

earnest phoenix
#

But it's not giving what I want

slender thistle
#

wdym it's not

amber thistle
slender thistle
#

what are you getting

earnest phoenix
#

@solemn latch bro I dont know what to tyoe

#

Type**

#

I am on android

slender thistle
#

I just gave you the search queries

earnest phoenix
#

client.on("message", msg=> {
if (msg.content === "!character") {
msg.reply

#

I have just typed thus

#

This**

solemn latch
#

its not like we magically know because someone told us...

slender thistle
#

Read the stackoverflow link above

solemn latch
#

we learned from the internet πŸ€”

earnest phoenix
#

not everything will straight up give you what to mindlessly copypaste in your code

#

learn to use your brain and think about what you need to do

#

the point of programming is to logically resolve problems

#

^

#

Not harsh at all

#

Its the truth

#

Shouldve been

#

client.on("message", msg=> {
if (msg.content === "!character") {
var things = ['Rock', 'Paper', 'Scissor'];
var thing = things[Math.floor(Math.random()*things.length)];

#

You wont get muted

#

Ive sworn at these guys and nothing happens to me

solemn latch
#

πŸ€·β€β™‚οΈ hes been asking the same question for what feels like 4 hours

earnest phoenix
#

Using var facepalm

pale vessel
#

var poggers

earnest phoenix
#

that's not even their code omegalul

#

client.on("message", msg=> {
if (msg.content === "!character") {
var things = ['Rock', 'Paper', 'Scissor'];
var thing = things[Math.floor(Math.random()*things.length)];

#

they did a ctrl c ctrl v with the snippet shared above

#

client.on("message", msg=> { if (msg.content === "!character") { var things = ['Rock', 'Paper', 'Scissor']; var thing = things[Math.floor(Math.random()*things.length)];

pale vessel
#

???

earnest phoenix
#

Is this right?

solemn latch
#

please dont copy paste code. youll never learn to code just by copy pasting like this.

earnest phoenix
#

@earnest phoenix well I am not mature

slender thistle
#

Help vampirism be like

earnest phoenix
#

why isnt it punishable

solemn latch
#

okay, 2 30am, time for an emergency sandwich and bed. gn lads and laddeets

earnest phoenix
#

tfw there's so many help vampires that you're happy once somebody who knows what they're doing asks a question

#

magic

#

@slender thistle can you pull out the ban hammer yet?

#

i was gonna send the gif but android does not like it apparently

#

dont forget to cache

#

Imagine caching lol

silver lintel
#

wrong person

earnest phoenix
#

hi

#

And its 1:36

umbral pollen
#
    at validChunk (_stream_writable.js:265:10)
    at StreamDispatcher.Writable.write (_stream_writable.js:299:21)
    at StreamDispatcher.Writable.end (_stream_writable.js:582:10)
at Client.<anonymous> (/app/index.js:384:43)
    at Client.emit (events.js:196:13)
    at MessageCreateAction.handle (/rbd/pnpm-volume/ce508b36-1345-4992-8429-90d810771830/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/ce508b36-1345-4992-8429-90d810771830/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/rbd/pnpm-volume/ce508b36-1345-4992-8429-90d810771830/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/rbd/pnpm-volume/ce508b36-1345-4992-8429-90d810771830/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/rbd/pnpm-volume/ce508b36-1345-4992-8429-90d810771830/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)```
#

How To Fix It ??

#

Pls Ping Me If You Can Help Me

fickle sapphire
#

' The "chunk" argument must be one of type string or Buffer.'

#

Read it

umbral pollen
#

So No Need To Fix It ??

open rune
#

Then why is your name β€œImMature YT”
@earnest phoenix the name isn't even I'm mature, it's just "Immature"

hazy sparrow
#

What's the best way to make a simple tictactoe game?

open rune
#

by defining a name of box with number?

#

like X = 1
O = 2

hazy sparrow
#

Ah, but technically it's possible using else if statments right?

open rune
#

yes

hazy sparrow
#

ok im rolling with that then

ionic dawn
ashen yarrow
#

how do I check what game someone is playing?

#

??

pale vessel
#

check their presence

ashen yarrow
#

how?

pale vessel
#

what library are you using?

ashen yarrow
#

js

#

v12

pale vessel
#

discord.js?

ashen yarrow
#

yessir

pale vessel
#

you can use member.user.presence.activities. member can be message.member or any member instance

#

this will return an array of games/apps that the member is playing

ionic dawn
#

Flazepe, such a good person

ashen yarrow
#

ok

void bone
#

How often can I get a bot to edit a message without abusing the API?

fluid basin
#

same rate as sending a message afaik

ashen yarrow
#

Discord has a rate limit of 5 in each request.

icy bluff
#

GOOD MORNING
GAMERS

ashen yarrow
#

gm

fluid basin
#

not here pls

icy bluff
#

Oh I just realized whoops

void bone
#

I'm doing a setInterval to edit a message every certain second

fluid basin
#

for what purpose/reason

ashen yarrow
#

why would u want to edit messages so fast?

fluid basin
#

if it doesn't need to be that often you shouldn't update it that often

void bone
#

to display the status of a minecraft server.

fluid basin
#

then you should only update when there is a change

ashen yarrow
#

or just change it ever 5 minutes

fluid basin
#

or at least, every 30 seconds/1 minute

void bone
#

30 seconds

#

oka

sand sparrow
#

Need someone to test my welcome message again, who's kind enough?

tame kestrel
#

@void bone
Hey! You can update your message up to like 5 per second iirc.

However, I think instead of trying to update something over and over again the best way to implement it would be to update the message, only when you have a different status. You should be mindful of how you implement your features so that you contact discord as little as possible, and that you don't create wasteful processing for your bot.

pale vessel
#

Need someone to test my welcome message again, who's kind enough?
@sand sparrow use an alt

sand sparrow
#

I don't have a alt

ashen yarrow
#

shaden dm me

pale vessel
#

create one

fluid basin
#

make one then

sand sparrow
#

and it's agaisnt tos

pale vessel
#

no

fluid basin
#

its not

sand sparrow
#

reee

#

It is

ashen yarrow
#

ill joinn

sand sparrow
#

:c

#

thx

fluid basin
#

show me where in the ToS

pale vessel
#

so we all should be banned then?

#

even tonkku and oliy has an alt
most mods too

#

smh

sand sparrow
#

Nvm, didn't work

#

Thanks.

fluid basin
#

next time, just make an alt

sand sparrow
#

-_-

fluid basin
#

you can use another browser or an incognito tab to have both accounts open

pale vessel
#

do that instead of bothering people

ashen yarrow
#

or just a second screen

sand sparrow
#

Bruh

ashen yarrow
#

Β―_(ツ)_/Β―

sand sparrow
#

I just asked

#

Jesus

slender thistle
#

PTB/Canary + vanilla client gang

fluid basin
#

well we did tell you what to do and you insisted not to, and now you're complaining

sand sparrow
#

You're then crying over me asking

#

Β―_(ツ)_/Β―

ashen yarrow
#

How do u write like that

pale vessel
#

~~text~~

ashen yarrow
#

cool

pale vessel
#

since you're on desktop

ashen yarrow
#

how did u do that with out getting the text like that?

fluid basin
#

smh imagine asking for help but not willing to listen

ashen yarrow
#

You're then crying over me asking
@sand sparrow kinda rude ngl

sand sparrow
#

Imagine caring about nothing big

ashen yarrow
#

Imagine caring about nothing big
@sand sparrow ikr? Imagine getting toxic though

fluid basin
#

hey hey, we're trying to be helpful here, you asked, so we helped and told you what to do

sand sparrow
#

Ikr?

fluid basin
#

anyways keep this channel on topic

ashen yarrow
#

good idea

sand sparrow
#

Help

fluid basin
#

help isn't going to come if you just say help

#

what do you need?

sand sparrow
#

lol

#

My welcome message wont work

ashen yarrow
#

bruhh

tardy hornet
#

where do i type if i need help with a code?

fluid basin
#

error/code?

#

here

ashen yarrow
#

do u get an error?

sand sparrow
#
client.on("guildMemberAdd", (member) => { //This is a welcone message code
  const guild = member.guild;
  if (!newUsers[guild.id]) newUsers[guild.id] = new Discord.Collection();
  newUsers[guild.id].set(member.id, member.user);

  if (newUsers[guild.id].size > 10) {
    const userlist = newUsers[guild.id].map(u => u.toString()).join(" ");
    guild.channels.find(channel => channel.name === "general").send("Welcome our new users!\n" + userlist);
    newUsers[guild.id].clear();
#

That wont work

#

I don't get any errors or anything

tardy hornet
#
 case 'rpink':
message.react('![Apink](https://cdn.discordapp.com/emojis/755304005206278235.webp?size=128 "Apink")')
break;```
its giving me errors,
sand sparrow
#

Not for me

fluid basin
#

please show me your error @tardy hornet

sand sparrow
#

^^

fluid basin
#

shaden are you using v12

sand sparrow
#

v12?

fluid basin
#

discord js?

sand sparrow
#

ye

fluid basin
#

discord js 12?

tardy hornet
fluid basin
#

if so, you need to use cache for channels

sand sparrow
slender thistle
#

Is there any indication in the user endpoint that a user has 2FA authentication enabled? Would I need OAuth for that?

sand sparrow
#

Cache?

fluid basin
#

shiv why do you need that anyways

sand sparrow
#

id?

fluid basin
#

guild.channels.cache

sand sparrow
#

1 sec

slender thistle
#

I'd say "something" but it's literally nothing but curiosity πŸ˜‚

ashen yarrow
#

@sand sparrow member.guild.channels.get('channelID').send("Welcome") u can also just do this

sand sparrow
#

Like that?

fluid basin
#

yes, you can get it through the api, the 'identity' scope will suffice to obtain it @slender thistle

slender thistle
#

Mhm, OAuth gang

sand sparrow
#

reeee

slender thistle
#

thanks qt ❀️

fluid basin
#

though the field might not be present, which in that case means its not 2fa enabled

#

np

ashen yarrow
#
bot.on('guildMemberAdd', member => {
    member.guild.channels.get('channelID').send("Welcome"); 
});``` @sand sparrow
fluid basin
#

@tardy hornet are you sure the error is coming from that line of code?

sand sparrow
#

hmmm

fluid basin
#

if not, its likely that its not coming from there

sand sparrow
#

Where should I add that?

fluid basin
#

thats up to you to try and figure it out

sand sparrow
#

-_-

fluid basin
#

can't expect us to spoonfeed all the way

sand sparrow
#

K

ashen yarrow
#

?

earnest phoenix
#

@ashen yarrow dont spoonfeed ty

ashen yarrow
#

when did I?

sand sparrow
#

Who me?

earnest phoenix
#

Uhh

#
bot.on('guildMemberAdd', member => {
    member.guild.channels.get('channelID').send("Welcome"); 
});``` <@ !297017395267108874>

@ashen yarrow this ig....?

ashen yarrow
#

oh my bad

tardy hornet
#

will it delete the message?

fluid basin
#

message.delete?

ionic dawn
#

do msg => { msg.delete({timeout: 5000}) }

sand sparrow
#

is it js?

ionic dawn
#

What?

sand sparrow
#

Javascript?

ionic dawn
#

what i sended?

sand sparrow
#

Doctor asked it it's gonna get deleted

ionic dawn
#

is not

sand sparrow
#

Is is "js" or something else?

ionic dawn
#

it is js

sand sparrow
#
      message.delete().catch(O_o=>{});
    }
  });
#

Use that instead

ionic dawn
#

wtf

sand sparrow
#

Are we even talking about the same thing?

carmine summit
#

is there a way to remove the highest rank of a guild member?

ionic dawn
#
message.channel.send("bla bla").then(msg => {
    msg.delete({ timeout: 10000 })
})
sand sparrow
#

Is it a command or a actual message?

ionic dawn
#

@sand sparrow his syntax was wrong, since he's not talkin anymore I guess he solved it

sand sparrow
#

Prob

ionic dawn
#

mate... thats just a piece of code to delete a message after being sended

sand sparrow
#

lol

earnest phoenix
#

is there a way to remove the highest rank of a guild member?
@carmine summit role?

ionic dawn
#

is there a way to remove the highest rank of a guild member?
@carmine summit the top role?

earnest phoenix
#

And what are you writing your bot in @carmine summit

#

@earnest phoenix god fix your fucking avatar

#

Is it broken

#

Or something

#

?

#

ΒΏ

#

no it's weird

#

U

ionic dawn
#

Well... he got a point

earnest phoenix
#

Sigh

carmine summit
#

yes

#

top role

#

of a member

ionic dawn
#

lib?

earnest phoenix
#

@carmine summit check his roles and order them from highest to lowest. Then remove the first one

ionic dawn
#

and take in mind that the bot only can remove top roles if he have a role over all the rest

earnest phoenix
#

^

#

And MANAGE_ROLES permission

ionic dawn
#

well... that was kinda obvious

carmine summit
#

how do i know which roles a member have?

ionic dawn
#

list them

carmine summit
#

like

#

automatic

#

something like member.roles

#

?

#

ish

ionic dawn
#

member.roles.map

carmine summit
#

ok lemme test

earnest phoenix
#

why map

#

collections are cooler

carmine summit
#

undefined

ionic dawn
earnest phoenix
#

@ionic dawn cache

ionic dawn
#

console.log the map thingy

#

oh right

earnest phoenix
#

bruh

carmine summit
#

member._roles

#

seem to work

earnest phoenix
#

it's GuildMemberRoleManager

ionic dawn
#

mate im in class im just typing by memory aigh

carmine summit
#

now i neet to

#

have

#

a lot of

#

if statements

earnest phoenix
#

you need to get the cache of the member roles / fetch them if you want instant updates

ionic dawn
#

why the if statements?

carmine summit
#

im making a ?demote

#

and i need to remove

#

the highest roles

ionic dawn
#

imagine having a "category" role and removing it instead of removing the actual staff role

carmine summit
#

so im thinking

if (member._roles.includes(roleid)) return member.roles.remove(roleid)
ionic dawn
#

demoting by "top role" isnt the best way to do it

earnest phoenix
#

message.member.roles just returns a manager
you can add .cache at the end to get from cache or .fetch() if you wanna spend a good few seconds (and rate limits) to fetch the whole member roles (but INSTANT UPDATES with fetch)

ionic dawn
#

prob checking by role perms and removing those are best

pale vessel
#

that looks correct

carmine summit
#

that looks correct
@pale vessel which

ionic dawn
#

like.. check if the user have ban perms and remove all the roles that allow him to ban

pale vessel
#

yours

carmine summit
#

ok

earnest phoenix
#

I'll go for cache unless I want it to be in sync with the member roles not the cache

#
message.member.cache

This'll return a Collection which you can sort from highest to lowest then get the first role

pale vessel
#

w h a t

earnest phoenix
#
Collection.sort(filter?: function);
carmine summit
#

o

#

k

earnest phoenix
#

what the fuck is _roles

carmine summit
#

list the roles

#

of a member

#

because thats what the json said

#

Β―_(ツ)_/Β―

#

uhh

#

roles.highest exists

pale vessel
#

_roles is an array of role snowflakes

ionic dawn
junior turtle
#
bot.on("messageReactionAdd", async (reaction, user) => {
        if(message.reaction) await reaction.message.fetch();
        if(user.bot) return;
        if(!reaction.message.guild) return;
        if(reaction.message.channel.id === "channel_id") {
            if(reaction.message.id === "message_id") {
                if(reaction.emoji.id === "emoji_id") {
                    await reaction.message.guild.members.cache.get(user.id).roles.add("role_id");
                    await reaction.message.guild.members.cache.get(user.id).roles.add("role_id");
                }
            }
        }
});

So in the code above I'm trying to make a role reaction system, but every time the bot reboots, it loses its previous listeners so it needs a newly generated message, and to solve that I thought maybe adding a listener for the message id would help with if(reaction.message.id === "message_id") {...FUNCTION...} , but for some reason it still needs a new message after restart - (Discord.js btw)

fluid basin
#

you will need to use partials

#

or you can fetch the message when your bot is ready

junior turtle
#

I am using partials

fluid basin
#

uh ok

#

not "message_id"

#

an ID is a snowflake

#

e.g. 307854775699898368

#

so you need to check if its "307854775699898368" and not "message_id"

junior turtle
#

yes I know, but I just replaced it in my question with "message_id"

fluid basin
#

oh ok

#

oh

#

if you're using partials

junior turtle
#

yea I replaced all of my id's with words in the question

fluid basin
#

you need to check if both message and reaction is cached

#

so you need to fetch both reaction AND message

#

right now I only see you fetching the message

junior turtle
#

the reaction is also fetched

#

upon a messageReactionAdd event

fluid basin
#

I don't see that in your code?

#

if you're using partials, it will not automatically fetch

#

ads

glossy lantern
#

My bot plss take in your server

fluid basin
#

@slender thistle uwu ^^^

slender thistle
fluid basin
#

thanks Imloved

slender thistle
#

please don't send the invite link in this server

glossy lantern
#

@slender thistle thx sit

fluid basin
#

@junior turtle so you can basically fetch the reaction, to get the guild and other information

ionic dawn
#

bot spam incoming

fluid basin
#

actually doody, do you have the exact error when you restart the bot?

junior turtle
#

I don't see that in your code?
@fluid basin well I don't really need to fetch the reaction on application restart, I just need a listener for the message so if reaction was added do this....

fluid basin
#

oh okay

#

which is why I'm asking if you have any errors

#

or the code is just not working

junior turtle
#

nope

#

the console is all clean

ionic dawn
#

the bot dsnt remember the stuff after the reboot

#

bot alzheimer

junior turtle
#

I tried debugging and checking bot permissions, and even the memory dump

#

bot alzheimer
lol

ashen yarrow
#

member.user.presence.activities I want to give out a role when someone plays a game, what event do I us

#

e

fluid basin
#

presenceUpdate @ashen yarrow

ashen yarrow
#

?docs preseceUpdate

#

oof

carmine summit
#
    if (message.author.id != '487511010886942720') return
    if (!args.length) return message.channel.send(`Error: No user specified\nUsage: ${prefix}demote ${message.guild.member('748128531174785035')}`)
    let member = args[0]
    let roles = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]))
    console.log(roles.roles.highest)
    roles.roles.remove(roles.roles.highest)
    message.channel.send(`${roles.roles.highest.name} has been removed from ${roles}`)
  }``` ![KEKlaugh](https://cdn.discordapp.com/emojis/750230044357689347.webp?size=128 "KEKlaugh")
junior turtle
#

So here it is. The first time when I trigger the command that 1) sends the embed then 2) awaits msgEmbed.send, and adds a reaction
it works fine the first time, but after the reboot, it won't listen to the same message and needs me to trigger the command again

#

so it requires the embed to be regenerated on reboot

ionic dawn
#

LΓ© Captcha

stuck scaffold
fluid basin
#

@junior turtle ok I think I know whats the problem

#

you need to have both REACTION AND MESSAGE in your partials

junior turtle
#

So here it is. The first time when I trigger the command that 1) sends the embed then 2) awaits msgEmbed.send, and adds a reaction
it works fine the first time, but after the reboot, it won't listen to the same message and needs me to trigger the command again
@junior turtle I have no idea if this issue could be caused by PM2 Module, or not... but if it makes a difference, the bot is running a PM2 Script

fluid basin
#

@stuck scaffold

  1. don't need to hide/censor your port
  2. make sure your mongodb server is running, on that port
stuck scaffold
#

mongodb server is running

fluid basin
#

then make sure your port is correct

junior turtle
#

const bot = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION"]});

stuck scaffold
#

yes

fluid basin
#

you're making life difficult by hiding it

stuck scaffold
#

correct

fluid basin
#

then why is it not connecting?

stuck scaffold
#

idk shrugowo

fluid basin
#

that means either you're connecting to the wrong port

stuck scaffold
#

no

fluid basin
#

or your mongodb server isn't actually running

junior turtle
#

or the application isn't connecting to that port

limber agate
#

-add

#

-botadd

fluid basin
limber agate
#

-bots

gilded plankBOT
fluid basin
#

then wait for it to be approved

fluid basin
#

yes I saw

slender thistle
pale vessel
fluid basin
#

make sure your mongodb is on that port

#

check your mongodb logs

#

usually at /var/log/mongodb/mongodb.log

#

if you didn't touch any mongodb server config when you installed and ran it

junior turtle
#

off topic but LMAO
@pale vessel lmao

stuck scaffold
fluid basin
#

its likely to be on the default port 27017

#

hrm

#

try using 127.0.0.1 instead of localhost

#

in your code

junior turtle
#

you need to have both REACTION AND MESSAGE in your partials
@fluid basin I do! It's on a client.on: const bot = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION"]});

fluid basin
#

that would be weird then

#

it worked just fine during my test just now

junior turtle
#

I have a feeling it might be because of pm2, but not sure

fluid basin
#

that is unlikely though

junior turtle
#

cause it works... or used to work fine on nodemon

fluid basin
#

OH

#

if(message.reaction) await reaction.message.fetch();

#

look at this

#

there isn't a message variable in the first place

junior turtle
#

ahhhhh

#

lmao

fluid basin
#

so your bot will never fetch the reaction message

#

oh and @junior turtle you need to fetch the reaction if you want to use reaction.emoji

#

reaction.emoji is not given

#

you might want to change that to reaction._emoji

#

(since each emoji has a guild and other info which might not be cached)

junior turtle
#

wasn't that changed in v12 tho?

fluid basin
#

holdup lemme try

#

yup, there is

#

but the id is null

#

so yes you need to use _emoji

#

unless you reaction.fetch()

#

well I guess you choose one for yourself