Overview
This node allows sending various types of messages and performing actions on Discord channels via a bot. It supports sending plain text messages, rich embedded messages, interactive prompts with buttons or select dropdowns, and executing specific actions like removing messages or managing user roles. The node is useful for automating communication and moderation tasks in Discord servers, such as posting announcements, collecting user input through interactive components, or managing user permissions.
Practical examples:
- Sending a welcome message with an embed when a new user joins.
- Posting a button prompt to gather user feedback or votes.
- Removing the last 100 messages from a channel as part of moderation.
- Adding or removing roles from users based on workflow logic.
Properties
| Name | Meaning |
|---|---|
| Replace the trigger placeholder | If enabled, the message sent by this node replaces a previously set placeholder message (e.g., 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. |
| Send to | Select the target text channel to send the message to. Requires valid credentials and a running bot with access to at least one text channel. |
| Type | Choose the type of interaction: • Message: Send a simple message. • Button Prompt: Send an interactive message with buttons, waiting for user response. • Select Prompt: Send an interactive dropdown list prompt. • Action: Perform a defined action instead of sending a message. • None: Clear placeholders or update bot status without sending a message. |
| Action | When Type is "Action", choose the action: • Remove messages • Add role to user • Remove role from user |
| User ID | The Discord user ID to add or remove roles from (required for role management actions). |
| Which roles | Roles to add or remove from the specified user (required for role management actions). |
| How many? | Number of recent messages to remove (max 150, only messages younger than 4 weeks) when removing messages. |
| Content | Text content of the message or prompt. Cannot be empty for button or select prompts. |
| Embed | Enable creation of rich embedded messages. |
| Color | Color of the embed sidebar (shown if Embed is enabled). |
| Title | Title of the embed. |
| URL | URL linked from the embed title. |
| Author name | Name shown 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. |
| Description | Description text inside the embed. |
| Thumbnail URL or base64 | URL or base64 image shown as the embed thumbnail. |
| Fields | Custom fields inside the embed, each with a title, value, and optional inline display. |
| Image URL or base64 | URL or base64 image displayed in the embed. |
| Buttons | Up to 5 buttons for button prompts, each with label, return value, and style (Primary, Secondary, Success, Danger). |
| Select | Options for select prompts, each with label, optional description, and return value. |
| Persistent | For button/select prompts, keeps the interactive component 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 selectable in a persistent select prompt. |
| Message ID | ID of the message to update when persistent is enabled; if empty, sends a new message. |
| Footer text | Footer text in the embed. |
| Footer icon URL or base64 | Image URL or base64 for the footer icon in the embed. |
| Displayed date | Timestamp shown in the embed. |
| Timeout | Time in seconds to wait for user interaction 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 (PNG, JPG) to the message by URL or base64. |
| Mention roles | Roles to mention in the message. |
| Placeholder | Placeholder text shown while the workflow is running, with animated dots. Can be replaced later by another Discord Send node. |
| Bot customization | Enable customizing the bot's activity and status. |
| Bot activity | Text describing the bot's current activity (e.g., "Playing X"). Needs periodic refresh to keep updated. |
| Bot activity type | Type of bot activity: Playing, Streaming, Listening, Watching. |
| Bot status | Bot's online status: Online, Idle, Do not disturb, Invisible. |
Output
The node outputs JSON objects containing information about the result of the sent message or performed action. Typical output fields include:
value: The value returned by the interaction (e.g., button clicked or select option chosen).guild: The Discord server (guild) identifier.channelId: The ID of the channel where the message or action occurred.userId: The ID of the user interacting or affected.userName: The username of the user.userTag: The user's tag (username#discriminator).messageId: The ID of the message sent or updated.action: The action performed (if applicable).
If the node sends binary data (e.g., attached images), it will be included as attachments but this is managed internally and not explicitly detailed here.
Dependencies
- Requires a valid Discord bot API key credential configured in n8n.
- The bot must be running and have appropriate permissions in the target Discord server(s), including sending messages, managing roles, and deleting messages.
- The node uses Discord API v10 endpoints.
- Requires network connectivity to Discord's API.
Troubleshooting
- Authentication errors: Occur if the provided API key is invalid or lacks required permissions. Verify the bot token and ensure the bot is invited to the server with correct scopes.
- Channel or role loading issues: If no channels or roles appear in dropdowns, check that the bot has permission to view channels and roles, and that the credentials are correctly set.
- Message removal limits: Discord API restricts bulk deletion to messages less than 2 weeks old and a maximum of 150 messages. Attempting to delete more or older messages will fail.
- Timeout behavior: Setting timeout to zero causes indefinite waiting for user interaction, which may stall workflows unintentionally.
- Placeholder replacement conflicts: Using "Replace the trigger placeholder" requires a placeholder to exist; otherwise, the message will be sent normally.
- Button/select interaction restrictions: Restricting interactions to triggering user or roles can cause ignored inputs if conditions are not met.