Overview
This node enables sending various types of messages and performing actions within Discord servers via a bot. It supports sending plain text messages, rich embedded messages, interactive prompts with buttons or dropdown selects, and executing specific actions such as removing messages or managing user roles. The node is useful for automating communication and moderation tasks in Discord communities.
Common scenarios include:
- Sending announcements or updates to specific channels.
- Creating interactive workflows where users respond by clicking buttons or selecting options.
- Moderation tasks like bulk deleting messages or assigning/removing roles from users.
- Updating the bot's status or activity dynamically.
For example, you could use this node to send a welcome message with buttons for new members to select their interests, or automatically remove recent spam messages in a channel.
Properties
| Name | Meaning |
|---|---|
| Replace the trigger placeholder | If enabled, the message sent will replace a previously set placeholder message (from a Discord Trigger node or another Discord Send node). |
| Send to the trigger channel | If enabled, sends the message to the same channel where the workflow was triggered without replacing any placeholder. |
| Choose server | Select the Discord server(s) where the message or action should be performed. Requires valid credentials and the bot to be present in those servers. |
| Send to | Select the text channel within the chosen server(s) where the message or action will be sent/performed. |
| Type | Choose the type of interaction: Message (plain or embed), Button Prompt, Select Prompt, Action (perform an action instead of sending a message), or None (clear placeholders or update bot status). |
| Action | When Type is "Action", choose the specific action: Remove messages, Add role to user, or Remove role from user. |
| User ID | For role management actions, specify the target user's ID. |
| Which roles | For role management actions, select one or more roles to add or remove from the user. |
| How many? | For message removal action, specify how many recent messages to delete (max 150, only messages younger than 4 weeks). |
| Content | Text content of the message or prompt. Required for button/select prompts. |
| Embed | Enable sending a rich embedded message with additional formatting and media. |
| Color | Color accent for the embed sidebar. |
| Title | Title text for the embed. |
| URL | URL linked from the embed title. |
| Author name | Name displayed as the author of the embed. |
| Author icon URL or base64 | Image URL or base64 string for the author's icon in the embed. |
| Author URL | URL linked from the author name in the embed. |
| Description | Main description text inside the embed. |
| Thumbnail URL or base64 | URL or base64 image shown as a thumbnail in the embed. |
| Fields | Custom fields inside the embed, each with a title, value, and optional inline display. |
| Image URL or base64 | Large image displayed in the embed. |
| Buttons | For button prompts, define up to 5 buttons with label, return value, and style (Primary, Secondary, Success, Danger). |
| Select | For select prompts, define multiple selectable options with label, optional description, and return value. |
| Persistent | For button/select prompts, if enabled, keeps the prompt visible after workflow completion. |
| Min select | Minimum number of options that must be selected in a persistent select prompt. |
| Max select | Maximum number of options that can be selected in a persistent select prompt. |
| Message ID | For persistent prompts, specify the ID of the message to update; otherwise, a new message is sent. |
| Footer text | Text displayed in the footer of the embed. |
| Footer icon URL or base64 | Image URL or base64 string for the footer icon, shown only if footer text is set. |
| Displayed date | Timestamp displayed in the embed. |
| Timeout | Time in seconds the workflow waits for a response on button/select prompts before continuing or stopping execution. Zero means wait indefinitely. |
| Restrict to triggering user | Only allow the user who triggered the workflow to interact with the prompt. |
| Restrict to mentioned roles | Only allow users with specified roles to interact with the prompt. |
| Files | Attach up to 5 images (URL or base64) to the message. |
| Mention roles | Specify roles to mention in the message. Requires the bot to have access to those roles. |
| Placeholder | A placeholder message shown while the workflow is running, replaced later by the actual response message. |
| Bot customization | Enable customizing the bot's activity and status. |
| Bot activity | Text describing the bot's current activity (e.g., "Playing X"). |
| Bot activity type | Type of activity displayed (Playing, Streaming, Listening, Watching). |
| Bot status | Status of the bot (Online, Idle, Do not disturb, Invisible). |
Output
The node outputs JSON objects containing information about the result of the sent message, prompt, or action. The output JSON includes:
value: The value returned by the prompt interaction (e.g., button clicked or option selected).serverId: The ID of the Discord server where the message/action occurred.channelId: The ID of the channel involved.userId: The ID of the user interacting or affected.userName: The username of the interacting user.userTag: The full Discord tag of the user (username#discriminator).messageId: The ID of the message sent or updated.action: The action performed (if applicable).
If the node sends binary data (such as attached images), it is handled as attachments to the message but not explicitly detailed in the output JSON.
Dependencies
- Requires a valid Discord bot API key credential configured in n8n.
- The bot must be added and running in the target Discord servers.
- The bot needs appropriate permissions to send messages, manage roles, and delete messages depending on the operation.
- The node uses Discord API v10 endpoints.
- The node relies on internal helper functions for loading servers, channels, and roles dynamically.
Troubleshooting
- Invalid Credentials: If the Discord API key is invalid or expired, the node will throw an authentication error. Recheck and update the API key credential.
- Bot Not Present in Server: If the bot is not added to the specified server or lacks permissions, messages or actions will fail. Ensure the bot is invited with correct scopes and permissions.
- Message Deletion Limits: Discord API restricts bulk deletion to messages less than 2 weeks old and a maximum of 150 messages at once. Attempting to delete older messages or too many at once will cause errors.
- Empty Content for Prompts: Button and select prompts require non-empty content. Leaving the content empty will cause validation errors.
- Timeout Handling: Setting timeout to zero causes indefinite waiting for user interaction, which may stall workflows unintentionally.
- Role Management: Adding or removing roles requires the bot to have Manage Roles permission and the roles must be lower than the bot’s highest role.
- Placeholder Replacement: Using the placeholder replacement feature requires coordination with other nodes setting placeholders; misuse may lead to unexpected message behavior.