-
Notifications
You must be signed in to change notification settings - Fork 17
Interaction Examples
javis86 edited this page Sep 14, 2024
·
7 revisions
Please refer to discordCommandManager
Adding components to a message creates a interaction between someone and the bot. All the components are created inside a Row Component.
- Button component
[
{
"type": 1,
"components": [
{
"type": 2,
"label": "Option 1",
"style": 3,
"custom_id": "click_opt1"
},
{
"type": 2,
"label": "Option 2",
"style": 4,
"custom_id": "click_opt2"
}
]
}
]
- Flow adding components
In this example, the node replies the command with ephemeral flag and then edits it.
Autocomplete commands has two parts. The first one is to respond when discord filters options when the command was not fired. The second one is when option is selected and command is fired.
let newMessage = {};
newMessage.action = "respondAutocomplete";
newMessage.autoCompleteChoices = ["Juan", "Javier", "Hernan"];
newMessage.interactionId = msg.payload.id;
return newMessage;
- Home
- Installation and setup
- Nodes
-
Examples
- Creating a thread
- Setting a bot status
- Reacting to a message
- Attach an image from disk
- Attach an image from buffer on an embed
- Attach an array of attachments
- Publish a new message on announcement channel
- Publish an existing message on announcement channel
- Set Role with discordPermission
- Remove Role with discordPermission
- Interaction Examples