Discord Trigger icon

Discord Trigger

Trigger based on Discord events

Overview

This node triggers workflows based on various Discord events, allowing automation in response to user and message activities within a Discord server. It is useful for scenarios such as monitoring messages or threads in specific channels, reacting to user join/leave events, handling role changes, or responding to custom commands and interactions.

Practical examples include:

  • Automatically welcoming new users when they join the server.
  • Triggering workflows when a message containing a specific keyword is posted.
  • Responding to button clicks or select menu interactions in Discord messages.
  • Monitoring user presence status changes to update external systems.
  • Executing actions when roles are added or removed from users.

Properties

Name Meaning
Listen to Select one or more text channels to listen to for triggering the workflow. If none selected, all channels will be listened to. Requires valid credentials and an active bot with access to at least one text channel.
From roles Optionally filter events by user roles. If no roles are selected, the trigger listens to everyone (@everyone). Applicable for certain event types like messages, threads, commands, user leaves, presence updates, etc.
Trigger type The type of Discord event to listen for. Options include: Message, Thread, Command, Interaction, User joins, User leaves, User presence update, User nick updated, User role added, User role removed.
Which roles For role add/remove events, specify which roles to listen for. If none selected, listens to all roles (@everyone).
Presence For presence update events, specify which presence state changes to listen for: Any change, Online, Offline, Do not disturb, Idle.
Pattern For message or thread events, define how to match the message content: Equals, Starts with, Contains, Ends with, Regex. Matching ignores mentions and trims whitespace.
Value The string value to test against messages or threads according to the selected pattern. Required for message and thread trigger types.
Name For command triggers, the name of the command to listen for (alphanumeric only). Required for command trigger type.
Description For command triggers, a description of the command. Required for command trigger type.
Input field type For command triggers, the type of input field expected: None, Text, Number, Integer, Boolean. Required for command trigger type.
Input field description For command triggers with an input field, a description of that field. Required if an input field type other than None is selected.
Input field required For command triggers with an input field, whether the input is required. Optional.
Case Sensitive For message or thread triggers, whether matching should be case sensitive. Defaults to false.
Bot Mention For message or thread triggers, if true, the message must mention the bot to trigger the workflow (in addition to other criteria).
Message ID For interaction triggers, the ID of the message containing the button or select menu to listen to. Required for interaction trigger type.
Placeholder A placeholder message shown in the channel when the workflow is running. Can be replaced by a response message from a Discord Send node.

Output

The node outputs JSON data representing the Discord event that triggered the workflow. The output includes fields such as:

  • content: The message content (if applicable).
  • guild: The guild (server) where the event occurred.
  • channelId: The ID of the channel related to the event.
  • userId, userName, userTag: Information about the user involved.
  • messageId: The ID of the message (if applicable).
  • presence: User presence status (if applicable).
  • nick: User nickname (if applicable).
  • addedRoles, removedRoles: Roles added or removed from the user (if applicable).
  • interactionMessageId, interactionValues: Data related to interactions (buttons/selects).
  • userRoles: Current roles of the user.
  • attachments: Any attachments included in the message.

If binary data is present (e.g., attachments), it is included in the output accordingly.

Dependencies

  • Requires a valid Discord API authentication token (bot token) configured in the node credentials.
  • The bot must be running and connected to the Discord server.
  • Access to the Discord API v10.
  • The node uses internal IPC communication to connect to a bot process named "bot".
  • Requires the Discord server to have accessible text channels and roles for selection.

Troubleshooting

  • No channels listed in "Listen to" property: Ensure your credentials are set correctly, the bot is running, and you have at least one accessible text channel. After fixing, close and reopen the modal to reload channels.
  • Commands not showing up in Discord: Verify the trigger is active and restart your Discord client.
  • Authentication errors: Check that the provided bot token is valid and has necessary permissions.
  • Workflow not triggering: Confirm the event type matches the configured trigger type and filters (channels, roles, patterns).
  • Regex pattern issues: Make sure the regex syntax is correct and tested outside before use.
  • Interaction triggers require correct message ID: Ensure the message ID corresponds to a message with persisted buttons or selects.

Links and References

Discussion