Discord Send icon

Discord Send

Sends messages, embeds and prompts to Discord

Overview

The Discord Send node allows you to send messages, embeds, and interactive prompts (such as buttons or selects) to Discord channels directly from your n8n workflows. It supports a wide range of message types, including plain text, rich embeds, file attachments, and interactive elements that can pause workflow execution until user interaction occurs. Additionally, it provides actions like removing messages or managing user roles, and can update the bot's status/activity.

Common scenarios:

  • Sending notifications or alerts to Discord channels.
  • Creating interactive workflows where users respond via Discord buttons or selects.
  • Automating moderation tasks such as removing messages or updating user roles.
  • Customizing bot presence/status based on workflow events.

Practical examples:

  • Notifying a channel when a new support ticket is created.
  • Prompting users with buttons to approve or reject a request.
  • Assigning or removing roles from users based on external triggers.
  • Cleaning up old messages in a channel automatically.

Properties

Name Meaning
Replace the trigger placeholder If enabled, replaces a previous placeholder message set by this or another Discord node. Useful for updating messages after a workflow completes.
Send to the trigger channel Sends the message to the same channel where the workflow was triggered. Does not replace any existing placeholder.
Send to Lets you specify which text channel(s) to send the message to. Requires proper credentials and at least one available text channel.
Type Selects the type of interaction:
- Message
- Button Prompt
- Select Prompt
- Action
- None
Action When "Type" is "Action", choose what action to perform:
- Remove messages
- Add role to user
- Remove role from user
User ID The ID of the user to add/remove a role from (used with "Add/Remove role" actions).
Which roles Specify roles to add or remove from the user (used with "Add/Remove role" actions).
How many? Number of last messages to remove (for "Remove messages" action; max 150, only messages <4 weeks old).
Content The main text content of the message. Required for button/select prompts.
Embed Enables creation of rich embed messages.
Color Color of the embed sidebar (when "Embed" is enabled).
Title Title of the embed (when "Embed" is enabled).
URL URL for the embed title (when "Embed" is enabled).
Author name Name displayed as the author in the embed.
Author icon URL or base64 Image for the author (URL or base64, shown if "Author name" is set).
Author URL Link for the author name (shown if "Author name" is set).
Description Description field in the embed.
Thumbnail URL or base64 Thumbnail image for the embed (URL or base64).
Fields List of fields (title/value pairs) to include in the embed.
Image URL or base64 Main image for the embed (URL or base64).
Buttons Up to 5 buttons for interactive prompts. Each button has label, value, and style (Primary, Secondary, Success, Danger).
Select Options for select prompts. Each option has label, description, and value.
Persistent Keeps button/select visible after workflow completion.
Min select Minimum number of options required for selection (persistent select prompts).
Max select Maximum number of options allowed for selection (persistent select prompts).
Message ID ID of the message to update (for persistent prompts). If empty, sends as new.
Footer text Text for the embed footer.
Footer icon URL or base64 Icon for the footer (URL or base64, shown if "Footer text" is set).
Displayed date Date/time to display in the embed footer.
Timeout Time (in seconds) to wait for user interaction before proceeding. 0 means wait indefinitely.
Restrict to triggering user Only the user who triggered the workflow can interact with the prompt.
Restrict to mentioned roles Only users with specified roles can interact with the prompt.
Files Attach up to 5 images/files to the message. Each file has a name and URL/base64 data.
Mention roles Roles to mention in the message. Requires proper credentials and at least one available role.
Placeholder Placeholder message shown while waiting for user interaction. Animated dots indicate workflow is running.
Bot customizaion Enable to customize bot activity and status.
Bot activity Text for the bot's "Now Playing" section. Must be refreshed periodically to persist.
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 an array of objects under the json field, each containing:

{
  "value": "...",        // Value returned by the Discord API (e.g., user response, confirmation)
  "channelId": "...",    // ID of the channel where the message/action occurred
  "userId": "...",       // ID of the user who interacted (if applicable)
  "userName": "...",     // Username of the interacting user (if applicable)
  "userTag": "...",      // Discord tag of the user (if applicable)
  "messageId": "...",    // ID of the sent or updated message
  "action": "..."        // Action performed (if applicable, e.g., 'addRole', 'removeMessages')
}
  • If the node is used for sending files, binary data is handled as file attachments but is not directly output in the json field.

Dependencies

  • External Service: Requires a Discord bot and valid Discord API credentials (discordApi).
  • n8n Configuration: Credentials must be set up in n8n for the Discord bot.
  • Environment: The bot must be running and have access to the relevant channels/roles.

Troubleshooting

Common issues:

  • Missing credentials: If Discord API credentials are not configured, the node will fail.
  • Bot permissions: The bot must have permission to send messages, manage roles, or delete messages in the target channel.
  • Channel/role not found: If no channels or roles are available, ensure the bot is running and has the necessary permissions.
  • Message limits: Attempting to remove more than 150 messages or messages older than 4 weeks will fail due to Discord API restrictions.
  • Empty content: For button/select prompts, the "Content" field cannot be empty.

Error messages:

  • "Error: [error details]": Indicates a problem with the Discord API call or connection. Check credentials and bot status.
  • "Cannot find channel/role": Ensure the bot has access and the correct permissions.
  • "Invalid input": Make sure all required fields are filled, especially for interactive prompts and actions.

Links and References

Discussion