Bot role with emoji
Hi,
I wrote the code for the bot. The essence of the code: When writing the !create command in the chat, the bot displays a message with a choice of role and reactions under it. The user clicks on a certain reaction and he is given a role.
Problem: the role is not issued, although the names of the roles are the same, the bot has administrator rights.
What is the problem? The terminal does not write errors.
10 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.[email protected]
v18.16.0
Tag suggestion for @tatina:
If you aren't getting any errors, try to place
console.log
checkpoints throughout your code to find out where execution stops.
- Once you do, log relevant values and if-conditions
- More sophisticated debugging methods are breakpoints and runtime inspections: learn moreI set the consoles, but there are no errors, what am I doing wrong?
can you send your code as a codeblock/pastebin
Tag suggestion for @tatina:
To share long code snippets use a service like gist, sourcebin, starbin, or similar instead of posting them as large code blocks.
Codeblocks:
```js
const Discord = require("discord.js");
// further code
```
becomes
Inline Code:
`console.log('inline!');` becomes
console.log('inline!');
you'll need the
GuildMessageReactions
intent in order to receive the messageReactionAdd
event (reaction collectors rely on this event)TypeError: collected.firstKey is not a function.
The filter for collectors has moved into the options:
How to fix it? Don't understand what I'm doing wrong.