forked from Markoudstaal/node-red-contrib-discord-advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Interaction Examples
Javier Colombera edited this page Aug 14, 2023
·
4 revisions
Pre-settings: You have to set this flow variables in order to use it
const clientId = flow.get("clientId");
const guildId = flow.get("guildId");
const token = flow.get("botToken");
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.
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