#Executing other commands using buttons

3 messages · Page 1 of 1 (latest)

north tusk
#

Hello! I'm working on a setup command that shows features (mod logs, welcome channels, autorole on/off, etc) and lets users click a button to setup the selected option.
I already have slash commands made for each feature, however, wanted to give users a place to configure everything in one command.

My question is- is there a way to have a slash command execute when a button is pressed? I know js command.execute(interaction) is a thing, but I'm a little lost on how I'd pass a button press into the execute function properly to run an already existing command.

tranquil burrowBOT
#
  • 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!
north tusk
#

current version of discord.js is 14.12.1 and node is 19.6.0