40 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.you are sending it twice right there
not sure what answer you expect now to be honest
where
channel.send(rules)
those are different
yeah but if you choose the same channel its gonna send it twice in that channel
yeah
yeah
so whats the issue
sends the ruels embed
then the successful sent one
You gonna need to be a bit more specific here
preferrably with a screenshot of whats happening
wait nvm
it was sending the rules embed twice w one command
it send rules twice and teh success command as well
weird
srry
quick question
whats returned here
bc its treated as a boolean
get returns the element with that key or undefined
ah
!role
is coercing it to a boolean value. if all you want to do is check if it's present, use has
instead of get
well
thats weird
bc my reaction roels are all broken
that's expected behavior (how it behaves, not your stuff being broken)
what is the customId of the interaction
"PRONOUNS_HEHIM": "814293352157282325",
tahts the role id
in the JSON file
not what i asked
.setCustomId('pronouns_heHim')
d.js caches are keyed by the id's
pronouns_heHim
is not a role idwdym
correct
its getting the button that was clicked
if you log a collection, you'll see something like where the
109838603...
is the key valuethe custom id of the button
in d.js' case, it's the element's id
which is "pronouns_heHim"
your custom id is not a role id
get takes a key
and converts it to uppercase
ergo, your get will not work
@superpekka336 Don't know if this has been asked/answered.. are you maybe hosting the bot twice? By accident.
weird
yeah
i was running it on replit
my old version
forgot to turn it off
ooh, so that is fixed?
while testing
yeah
new problem
Ooh
Sorry!
whack a mole
allg
ty
so how would i fix it?
log your values, check the roles.cache collection and inspect it manually to see if the id is present there
k
console.log(role);
right?
undefined
i think i figured out whats wrongPRONOUNS, DEPARTMENT, and OTHER
ok that killed the bot
nvm it fixed itself
¯\_(ツ)_/¯