#Hey, i need help with a command

8 messages · Page 1 of 1 (latest)

glass urchin
#

I am making a verify command and I would like to know how to implement that the role is given at the moment of hitting the button, because the current function is that the embed and the button are created, but it gives you the role atomatically.
(is v14.11 but i cant find the tag)

Me code: https://hastebin.com/share/emerekivog.javascript

weary valveBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
muted orchidBOT
glass urchin
#

pls the topic dont help me

long plover
# glass urchin pls the topic dont help me

You have to wait to receive the component interaction to add the role. A component interaction collector will receive the interaction from the button and you can execute any logic you need upon receiving the interaction event.
What have you tried? Are you receiving any errors?

glass urchin
long plover
#

You would have to create a component collector on the message with your button. You can get the message reference by awaiting the call to reply() where you send the message with the button. Use that message to create the collector as the guide shows.

muted orchidBOT
#

guide Popular Topics: Collectors - Interaction collectors
read more