Discord Send icon

Discord Send

Sends messages, embeds and prompts to Discord

Overview

This node enables sending various types of messages and interactive prompts to Discord channels. It supports simple text messages, rich embedded messages, interactive button or select dropdown prompts that wait for user responses, and specific actions like removing messages or managing user roles. This flexibility makes it useful for automating Discord server interactions such as announcements, polls, role assignments, and message moderation.

Common scenarios include:

  • Sending announcements or updates with optional rich embeds.
  • Creating interactive workflows where users respond via buttons or dropdowns.
  • Managing user roles automatically based on workflow logic.
  • Cleaning up channels by bulk deleting recent messages.
  • Updating bot status or clearing placeholders in channels.

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 The type of interaction:
- Message: simple message
- Button Prompt: interactive buttons
- Select Prompt: dropdown list
- Action: perform an action
- None: no message, just update/clear state
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 actions).
Which roles Roles to add or remove from the specified user (required for role actions).
How many? Number of last 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/select prompts.
Embed Enable rich embed creation for messages.
Color Color of the embed sidebar.
Title Embed title.
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 icon (shown if author name is set).
Author URL URL linked from the author name.
Description Embed description text.
Thumbnail URL or base64 URL/base64 of thumbnail image in embed.
Fields Custom fields in the embed; each has a title, value, and inline display option.
Image URL or base64 Main image URL/base64 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 option has label, optional description, and return value.
Persistent For button/select prompts, keeps the prompt visible after workflow finishes.
Min select Minimum number of options that must be selected in persistent select prompts.
Max select Maximum number of options selectable in persistent select prompts.
Message ID ID of the message to update when persistent is enabled; if empty, sends a new message.
Footer text Footer text in embed.
Footer icon URL or base64 Image URL/base64 for footer icon (shown if footer text is set).
Displayed date Timestamp shown in embed.
Timeout Time in seconds to wait for user response 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 bot permissions and available roles.
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 X"). Needs periodic refresh to keep updated.
Bot activity type Type of bot activity: Playing, Streaming, Listening, Watching.
Bot status Bot presence status: Online, Idle, Do not disturb, Invisible.

Output

The node outputs an array of JSON objects, each representing the result of sending a message or performing an action. Each output item includes:

  • value: The main returned value, e.g., user selection or confirmation.
  • 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 interacting user.
  • userTag: The full Discord tag of the user.
  • messageId: The ID of the sent or updated message.
  • action: The performed action type (if applicable).

If the node sends interactive prompts, the output reflects the user's response. For actions like role management or message removal, the output confirms the performed operation.

Binary data is not output by this node.

Dependencies

  • Requires a valid Discord API authentication token configured in n8n credentials.
  • The bot must be running and have appropriate permissions in the target Discord server (sending messages, managing roles, deleting messages).
  • Channels and roles lists are dynamically loaded from Discord via helper methods.
  • The node uses internal IPC communication to handle sending messages and prompts asynchronously.

Troubleshooting

  • Missing or invalid credentials: The node throws errors if the Discord API key is missing or invalid. Ensure credentials are correctly set.
  • Insufficient bot permissions: Actions like adding/removing roles or deleting messages require the bot to have proper permissions in the server.
  • Channel or role not found: If the selected channel or role does not exist or the bot lacks access, the node will fail.
  • Message deletion limits: Discord API restricts bulk deletion to messages younger than 2 weeks and max 150 messages; exceeding these causes errors.
  • Timeout handling: For button/select prompts, setting timeout to 0 waits indefinitely; otherwise, the workflow proceeds after timeout.
  • Placeholder replacement issues: Enabling placeholder replacement requires a prior placeholder message; otherwise, the node may not behave as expected.
  • Interactive prompt restrictions: Restricting interaction to triggering user or roles may cause no response if conditions are unmet.

Links and References

Discussion