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
d.js toolkit
d.js toolkitβ€’2y ago
β€’ 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.
d.js docs
d.js docsβ€’2y ago
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 more
π™π˜Όπ™π™„π™‰π˜Ό
I set the consoles, but there are no errors, what am I doing wrong?
Chelsea
Chelseaβ€’2y ago
can you send your code as a codeblock/pastebin
d.js docs
d.js docsβ€’2y ago
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
const Discord = require("discord.js");
// further code
const Discord = require("discord.js");
// further code
Inline Code: `console.log('inline!');` becomes console.log('inline!');
duck
duckβ€’2y ago
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.
d.js docs
d.js docsβ€’2y ago
The filter for collectors has moved into the options:
- const collector = message.createReactionCollector(collectorFilter, { ...options });
+ const collector = message.createReactionCollector({ filter: collectorFilter, ...options });
- const collector = message.createReactionCollector(collectorFilter, { ...options });
+ const collector = message.createReactionCollector({ filter: collectorFilter, ...options });
π™π˜Όπ™π™„π™‰π˜Ό
How to fix it? Don't understand what I'm doing wrong. bonkflashingheart
Want results from more Discord servers?
Add your server