-
Notifications
You must be signed in to change notification settings - Fork 0
discordMessageManager
The discordMessageManager provides multiple ways to interact with messages in Discord. The current features are:
- Send messages to a Discord Channel.
- Send private messages to users.
- Edit messages in Discord Channels.
- React to messages.
- Publish messages to announcement channel.
- Delete messages in Discord Channels.
- Add attachments to messages.
- Add components like buttons, text inputs and select menus to messages.
Currently it's not possible to edit or delete private messages. Nor is it possible to add an attachment to a message when editing it.
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 | create, edit, reply, react, crosspost and delete | The action you wish to perform. When not set create is default. |
msg.payload |
String | The string you wish to send or the new content of a message when editing. | |
msg.channel |
String or Object | The channel ID or a channel Object that contains the ID. Required when sending, editing or deleting in a channel. | |
msg.user |
String or Object | The user ID or a user Object that contains the ID. Required when sending a message to a user. | |
msg.message |
String or Object | The message ID or a message Object that contains the ID. Required when editing or deleting a message. | |
msg.embeds |
Object or Array | An embed object or an array of embed objects. | |
msg.attachments |
String, Object or Array | A location to an attachment. Can be online by URL, an object with a buffer payload or a file in the local filesystem. | |
msg.timedelay |
Number | The time in milliseconds to wait before deleting a message. | |
msg.components |
Array | An array of component objects. |
To send messages to a Discord channel these variables are required:
Input | Type | Description |
---|---|---|
msg.payload |
String | The content you wish to send. |
msg.channel |
String or Object | The channel ID or a channel Object that contains the ID. Required when sending, editing or deleting in a channel. |
The following variable is optional:
Input | Type | Description |
---|---|---|
msg.attachments |
String, Object or Array | A location to an attachment. Can be online by URL, an object with a buffer payload or a file in the local filesystem. |
To send private messages to a user the following variables are required:
Input | Type | Description |
---|---|---|
msg.payload |
String | The content you wish to send. |
msg.user |
String or Object | The user ID or a user Object that contains the ID. Required when sending a message to a user. |
The following variable is optional:
Input | Type | Description |
---|---|---|
msg.attachments |
String, Object or Array | A location to an attachment. Can be online by URL, an object with a buffer payload or a file in the local filesystem. |
To send embeds you can follow the same procedure as sending a message to a channel or user. However the following changes are required:
Input | Type | Description |
---|---|---|
msg.embeds |
Object or Array | This needs to be an embed Object or Array of embed Objects. Find out how to create this here. |
Editing messages is currently only possible in channel, so it's not possible for private messages. The required variables are:
Input | Type | Description |
---|---|---|
msg.action |
String | Needs to be set to 'edit'. |
msg.payload |
String | The new content of the message. |
msg.channel |
String or Object | The channel ID or a channel Object of the channel where the message is. |
msg.message |
String or Object | The message ID or a message Object of the message you wish to delete. |
It's currently not possible to add an attachment when editing a message.
To edit an existing embed message or change a normal message into an embed, follow the same procedure as shown above with normal message editing. However the following changes are required:
Input | Type | Description |
---|---|---|
msg.embeds |
Object or Array | This needs to be an embed Object or Array of embed Objects. Find out how to create this here. |
Deleting messages is currently only possible in channel, so it's not possible for private messages. The required variables are:
Input | Type | Description |
---|---|---|
msg.action |
String | Needs to be set to 'delete'. |
msg.channel |
String or Object | The channel ID or a channel Object of the channel where the message is. |
msg.message |
String or Object | The message ID or a message Object of the message you wish to delete. |
To send buttons, text inputs and select menus you can follow the same procedure as sending a message to a channel or user. However the following changes are required:
Input | Type | Description |
---|---|---|
msg.components |
Array | This needs to be an Array of component Objects. Find out how to create this here. |
Replying messages is currently only possible in channel, so it's not possible for private messages. The required variables are:
Input | Type | Description |
---|---|---|
msg.action |
String | Needs to be set to 'reply'. |
msg.payload |
String | The message for the reply. |
msg.channel |
String or Object | The channel ID or a channel Object of the channel where the message is. |
msg.message |
String or Object | The message ID or a message Object of the message you wish to reply. |
Add a reaction to a message.
Input | Type | Description |
---|---|---|
msg.action |
String | Needs to be set to 'react'. |
msg.payload |
String | Unicode of emoji or custom guild emoji name. |
msg.channel |
String or Object | The channel ID or a channel Object of the channel where the message is. |
msg.message |
String or Object | The message ID or a message Object of the message you wish to react to. |
- 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