Discord Interaction icon

Discord Interaction

Sends messages, embeds and prompts to Discord

Discord Interaction

AI-generated

Overview

This node, named Discord Interaction, allows users to interact with Discord by sending messages, embeds, and prompts, or performing various actions such as managing messages, roles, and channel statuses within a Discord server (guild). It is useful for automating Discord server management and communication tasks, such as sending announcements, confirming user actions, retrieving or removing messages, and managing user roles.

Use Case Examples

  1. Sending a simple text message to a specific Discord channel.
  2. Sending an embedded message with rich content like images, fields, and author information.
  3. Prompting users with a confirmation message to decide whether to continue an interaction.
  4. Fetching the last N messages from a channel for moderation or logging purposes (e.g., getMessages action).

Properties

Name Meaning
Type Specifies the type of interaction to perform: sending a message, performing an action, or requesting user confirmation.
Action Specifies the type of action to perform when Type is set to 'Action'. Actions include getting messages, checking or toggling channel status, removing messages, and managing user roles.
Server Name or ID Specifies the Discord guild (server) where the action or message will take place.
Channel Name or ID Specifies the text channel within the guild where the message or action will be applied.
Message Limit Number of messages to fetch when using the 'Get Messages' action (max 100).
Toggle Action Choose whether to enable or disable triggers for the channel when toggling channel status.
How Many? Number of last messages to remove when using the 'Remove Messages' action (max 100).
User ID The ID of the user to add or remove roles from when managing roles.
Which Role Names or IDs Specifies the roles to add or remove from the user.
Content The text content of the message to send. Cannot be empty when using button/select prompts.
Embed Whether to create an embed message instead of a regular text message.
Color Color of the embed message (if embed is true).
Title Title of the embed message.
URL URL associated with the embed message title.
Author Name Name of the author shown in the embed message.
Author Icon URL or Base64 URL or base64 image of the author's icon in the embed message.
Author URL URL linked to the author name in the embed message.
Description Description text of the embed message.
Thumbnail URL or Base64 URL or base64 image for the embed thumbnail.
Fields Additional fields to add to the embed message, each with a title, value, and inline display option.
Image URL or Base64 URL or base64 image to display in the embed message.
Footer Text Footer text of the embed message.
Footer Icon URL or Base64 URL or base64 image for the footer icon in the embed message.
Displayed Date Timestamp to display in the embed message.
Files Allows attaching up to 5 images to the message.
Mention Role Names or IDs Roles to mention in the message.
Additional Fields Additional options for confirmation type, including timeout and custom labels for Yes/No buttons.

Output

JSON

  • channelId - ID of the Discord channel involved in the interaction or action.
  • isDisabled - Boolean indicating if the channel is disabled for triggers (for checkChannelStatus action).
  • isEnabled - Boolean indicating if the channel is enabled for triggers (for checkChannelStatus action).
  • success - Boolean indicating success of toggleChannelStatus action.
  • userId - ID of the user involved in role management actions.
  • userName - Username of the user involved in the interaction.
  • userTag - User tag (username#discriminator) involved in the interaction.
  • messageId - ID of the message involved in the interaction.
  • action - The action performed or type of interaction.
  • value - General value returned from the interaction or action.
  • confirmed - Boolean indicating user confirmation response (for confirm type).

Dependencies

  • Discord Bot API (via an API key credential)
  • Node IPC for communication with a Discord bot process

Troubleshooting

  • Ensure the Discord bot credentials are correctly set and the bot is running to allow communication.
  • If no guild (server) is selected, channel and role options cannot be loaded; select at least one guild first.
  • IPC timeout errors may occur if the bot process does not respond within 30 seconds; ensure the bot is running and reachable.
  • When using confirmation type, if no user response is received within the timeout, the interaction is considered expired.
  • Discord API limits apply, such as a maximum of 100 messages fetched or 150 messages removed, and messages must be less than 4 weeks old for removal.

Links

Discussion