button question

is it possible for me to make a button where when its clicked i can send a message back to the bot that will make it do something else?
14 Replies
d.js toolkit
d.js toolkit2y 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.
treble/luna
treble/luna2y ago
you can but why would you You can also instantly handle whatever you want your bot to do
keekztah
keekztahOP2y ago
for a command that im working on. for example, if i want to have a command where i warn someone with a button, after i press the 'warn' button can i make my response after that the 'reason' without using a slash command?
treble/luna
treble/luna2y ago
paqs the reason in your customid or something
keekztah
keekztahOP2y ago
paqs?
treble/luna
treble/luna2y ago
Pass*
Cae
Cae2y ago
How exactly would this work?
keekztah
keekztahOP2y ago
so an embed would show up after running the warn command, the button options would be remove-warn, clear-warns, etc as if they were all subcommands if i were to click remove-warn, bot will ask me "which warn do you want to remove" then i can reply with "2" then it removes warn #2 etc @caelestes.
treble/luna
treble/luna2y ago
use collectors
keekztah
keekztahOP2y ago
collector.on('collect', async (interaction) => {
if (interaction.customId === 'remove') {
if (interaction)
}
collector.on('collect', async (interaction) => {
if (interaction.customId === 'remove') {
if (interaction)
}
from here i am stuck
treble/luna
treble/luna2y ago
How do you define your collector
keekztah
keekztahOP2y ago
yes, one person. what if i wanted to do warn(button) reason(string)
d.js docs
d.js docs2y ago
guide Other Interactions: Modals read more
keekztah
keekztahOP2y ago
hmm, ok. do modals require that title bar thing? or can there only be like description nvm i think i will just figure that out lol thank you so much
Want results from more Discord servers?
Add your server