-
Notifications
You must be signed in to change notification settings - Fork 16
discordCommandManager
javis86 edited this page Sep 14, 2024
·
3 revisions
The discorCommandMananger node lets you to create, to update and to delete global application commands and guild application commands.
These are all the inputs this node takes. Below are specifc examples for use cases which also shows what variables are required for that action.
Input | Type | Options | Description |
---|---|---|---|
msg.action |
String |
set , get , delete , deleteAll
|
The action you wish to perform. |
msg.command |
Object | command json | The string with the command that you need to create or update (By default, the action 'set' acts like an upsert) |
msg.guild or msg.guildId
|
String or number | guild Id or NULL | The Guild ID where the action is performed, if guild is null or empty, the action is performed over global application command context |
msg.commandId |
String or number | command Id | It´s Used with the actions set or delete
|
All examples are supported by a function node that defines the inputs for discordCommandManager node
msg.action = "set";
msg.command = {
name: "blop",
description: "Replies with blop!"
};
return msg;
msg.action = "set";
msg.commands = {
"name": "blep",
"type": 1,
"description": "Send a random adorable animal photo",
"options": [
{
"name": "animal",
"description": "The type of animal",
"type": 3,
"required": true,
"choices": [
{
"name": "Dog",
"value": "animal_dog"
},
{
"name": "Cat",
"value": "animal_cat"
},
{
"name": "Penguin",
"value": "animal_penguin"
}
]
},
{
"name": "only_smol",
"description": "Whether to show only baby animals",
"type": 5,
"required": false
}
]
}
return msg;
msg.action = "set";
msg.commands = {
"name": "echo3",
"description": "Search discordjs.guide!",
"options": [
{
"name": "query",
"description": "Phrase to search for",
"type": 3, // Represents STRING input
"autocomplete": true
}
]
};
return msg;
A UI-based command that shows up when you right click or tap on a message Application command types
msg.action = "set";
msg.commands = {
"name": "Bookmark",
"type": 3
};
return msg;
msg.action = "delete";
msg.commandId = "<< command_id >>";
msg.guildId = "<< guildId >>";
return msg;
msg.action = "deleteAll";
msg.guildId = "<< guildId >>";
return msg;
msg.action = "get";
msg.guildId = "<< guildId >>";
return msg;
- 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