#Could you trigger a command function with a button like interaction create does?

7 messages · Page 1 of 1 (latest)

uneven pike
#

• 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.

weak laurel
#

sure

#

I did it in my bot just fine, using the custom id

woeful magnet
#

You'd have to give it a custom id. It'll trigger the interactionCreate event and you'll have to check if its a button interaction and then execute the right command based on the custom id

weak laurel
#

as I said, yes you can do that

woeful magnet
#

You can create a button handler for example in another file that you can use whenever the interaction is a button, that's how I do it

weak laurel
#

I have one on my bot, on my GitHub if you want an example 🤷‍♂️