Discord Send icon

Discord Send

Sends messages, embeds and prompts to Discord

Overview

This node enables sending various types of messages and interactions to Discord channels via a bot. It supports simple text messages, rich embedded messages, interactive prompts with buttons or select dropdowns, and specific actions like managing user roles or removing messages. The node is useful for automating communication in Discord servers, such as posting announcements, collecting user input through interactive components, or moderating channels by removing messages or updating user roles.

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 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.
Send to Select the target text channel to send the message to. Requires valid credentials and bot permissions.
Type Type of interaction to perform: message (simple message), button (interactive buttons), select (dropdown list), action (perform an action), or none (no message, just clear placeholder or update status).
Action When Type is action, choose the action: remove messages, add role to user, or remove role from user.
User ID ID of the user 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 less than 4 weeks old) 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 (when embed is enabled).
Title Title of the embed.
URL URL associated with the embed title.
Author name Name of the author shown in the embed header.
Author icon URL or base64 Image URL or base64 string for the author's icon in the embed.
Author URL URL linked to the author name in the embed.
Description Description text inside the embed.
Thumbnail URL or base64 URL or base64 image for the embed thumbnail.
Fields Custom fields inside the embed; each has 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 has a label, return value, and style (Primary, Secondary, Success, Danger).
Select Options for select dropdown prompts; each option has a 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 ID of the message to update instead of sending a new one (used with persistent prompts).
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 to show 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 waiting for user interaction in button/select prompts, with animated dots indicating workflow running.
Bot customization Enable customizing the bot's activity and status.
Bot activity Text describing the bot's current activity (e.g., "Playing", "Streaming").
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 sent message or performed action. The output JSON includes:

  • value: The main returned value from the interaction (e.g., button clicked value).
  • guild: The Discord server (guild) ID.
  • channelId: The ID of the channel where the message was sent.
  • userId: The ID of the user interacting or targeted.
  • userName: The username of the interacting user.
  • userTag: The full Discord tag of the user.
  • messageId: The ID of the sent or updated message.
  • action: The action performed (if applicable).

If the node sends binary data (such as attached images), it would be included accordingly, but this node primarily handles JSON message data and embeds.

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 dynamically loads available channels and roles from the connected Discord server for selection.
  • Uses internal IPC communication to handle sending messages and prompts asynchronously.

Troubleshooting

  • Common issues:

    • Missing or invalid API credentials will cause connection errors.
    • Insufficient bot permissions may prevent sending messages, managing roles, or deleting messages.
    • Trying to remove more than 150 messages or messages older than 4 weeks will fail due to Discord API limitations.
    • Empty content for button or select prompts will cause errors since these require non-empty messages.
    • Specifying a message ID to update that does not exist or belongs to another channel may cause failures.
  • Error messages:

    • Connection errors typically indicate invalid or missing API keys.
    • Permission errors suggest the bot lacks required Discord permissions.
    • Validation errors occur if required parameters are missing or invalid (e.g., user ID for role actions).
  • Resolutions:

    • Verify and reconfigure the Discord API credentials.
    • Ensure the bot has necessary permissions in the Discord server.
    • Check parameter values carefully, especially for required fields.
    • Refresh the modal to reload channels and roles if they do not appear.

Links and References

Discussion