Second step confirmation
Im making a deposit system to deposit USD, does discordjs allow to hold slash command execution and send a panel with 2 buttons confirm and cancel before proceeding the command?
8 Replies
• 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.without a need of database
You can send an ephemeral reply with buttons and handle button interactions.
Yep but buttons are recognized by ids, what if I make a deposit and want to say are you sure you want to deposit this amount with buttons confirm and decline, how will it know what was the deposit amount if buttons only trigger with ids?
is saving message id and attaching to deposit amounts etc. the only way?
im not sure if there are better ways to handle this with discordjs
just what im asking is how to make button linked to specific deposit to confirm or cancel it
if confirm it proceeds the deposit
You can set the custom id like
confirm-deposit:5
and split it by : when receiving the interactionohh
so button identification will be confirm-deposit, but can get parameters through it?
You can pass any string to the custom id, that's why it's called custom.
kk thanks for giving some insight