This Section will cover how to create a button, multiple buttons and also detect and handle button inputs.
- Each Button needs a Custom ID to detect when it was Pressed
- You can get a Emoji on Windows using Win+.
Create One Button¶
This Construction will trigger when the
!buttons Command was run, that will create and send the button with the Send Message(Components) Block.
Create Multiple Buttons¶
Detect and handle a Button Press¶
You can use the Interaction Event to detect a Button Press using the Custom ID. Also to get the Current Time and Date you use the
Create Date Block and using the
Format Date Block you can get the Date in a Text Type. To now send a message back to the User that used the Button, you can use the Reply to Interaction Block.
(Ephemeral means only visible to the user)
Since you now know how to handle one button, you can do the same for the other example buttons and try to send a Message Back!
Still Issues or Questions?¶
If you have Issues or any questions you can always ask on the Discord Bot Builder Discord, or send me a DM: