Discord Send icon

Discord Send

Sends messages, embeds and prompts to Discord

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 and waiting for their response.
  • Removing the last 100 messages from a channel as part of a cleanup workflow.
  • Adding or removing roles from users based on certain triggers.

Properties

Name Meaning
Replace the trigger placeholder If enabled, the message sent by this node replaces 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 text channel where the message will be sent. Requires valid credentials and bot presence.
Type Type of interaction: Message (plain or embed), Button Prompt (interactive buttons), Select Prompt (dropdown list), Action (perform predefined action), None (clear placeholder or update bot status).
Action When Type is "Action", choose the specific action: Remove messages, Add role to user, 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 linked from the embed title.
Author name Name shown as author in 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 Description text inside the embed.
Thumbnail URL or base64 URL or base64 image shown as 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 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 component visible after workflow finishes if enabled.
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 instead of sending a new one (used with persistent components).
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 in button/select prompts before continuing or stopping execution. 0 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. Requires valid credentials and at least one available role besides @everyone.
Placeholder Placeholder message 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 Status of the bot: Online, Idle, Do not disturb, Invisible.

Output

The node outputs JSON objects containing information about the sent message or performed action. The output includes:

  • value: The returned value from the interaction (e.g., button clicked value, selected option).
  • guild: The guild (server) ID where the message/action occurred.
  • channelId: The channel ID where the message was sent or action performed.
  • userId: The ID of the user interacting or affected.
  • userName: The username of the user interacting or affected.
  • userTag: The full user 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 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 running and connected to the target Discord server.
  • The bot needs appropriate permissions to send messages, manage roles, and delete messages in the specified channels.
  • The node uses Discord API v10 endpoints.
  • Requires network access to Discord API.

Troubleshooting

  • Invalid credentials or authentication errors: Ensure the API key credential is correct and the bot token is valid. Re-test the credential connection.
  • Missing permissions: The bot must have permission to send messages, manage roles, or delete messages depending on the action. Check the bot's role permissions in the Discord server.
  • Channel or role lists not loading: Make sure the bot is present in the server and has permission to view channels and roles. Refresh the node modal after changes.
  • Message deletion limits: Discord API only allows bulk deleting messages younger than 2 weeks and up to 150 messages at once. Attempting to delete older messages or more than 150 will fail.
  • Timeouts on prompts: If timeout is set to 0, the node waits indefinitely for user interaction. Set a reasonable timeout to avoid stuck workflows.
  • Placeholder replacement issues: If using placeholders, ensure the previous placeholder message exists and was set by a compatible node; otherwise, replacement will fail.
  • Error handling: If continue-on-fail is disabled, errors during sending or actions will stop the workflow. Enable continue-on-fail to capture errors per item.

Links and References

Discussion