Overview
This node triggers workflows based on various Discord events. It listens to specific Discord server activities such as messages, commands, user interactions with buttons or selects, user joins and leaves, presence updates, and role changes. This is useful for automating responses or actions in a Discord server when certain events occur.
Common scenarios include:
- Triggering a workflow when a message matching a pattern is sent in selected channels.
- Responding to custom slash commands issued by users.
- Reacting to user interactions with persistent buttons or select menus.
- Monitoring user join/leave events to welcome or log members.
- Tracking presence status changes (online, offline, idle, etc.).
- Detecting when roles are added or removed from users.
For example, you could use this node to automatically greet new users when they join, moderate messages containing specific keywords, or update external systems when user roles change.
Properties
Name | Meaning |
---|---|
Listen to | Select one or more text channels to listen to for triggering the workflow. If none selected, all channels are listened to. Requires valid credentials and bot running. |
From roles | Filter events by user roles. If no roles are selected, it listens to everyone (@everyone ). Only applicable for certain event types like messages, commands, user leaves, presence updates, role changes, and interactions. |
Trigger type | Type of Discord event to listen for. Options: Message, Command, Interaction, User joins, User leaves, User presence update, User role added, User role removed. |
Which roles | For role added/removed events, specify which roles to listen for. If none selected, listens to 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 events, how to match the message content: Equals, Starts with, Contains, Ends with, Regex. The message is tested after removing mentions and trimming whitespace. |
Value | The string value to test against messages when using message trigger type. Required for message triggers. |
Name | The name of the command to listen for when using command trigger type. Must be alphanumeric. Required for command triggers. |
Description | Description of the command for command triggers. Required for command triggers. |
Input field type | For command triggers, the type of input field expected: None, Text, Number, Integer, Boolean. Required for command triggers. |
Input field description | Description of the input field for command triggers. Required if input field type is not None. |
Input field required | Whether the input field for the command is required. Optional boolean for command triggers. |
Case Sensitive | For message triggers, whether the message matching should be case sensitive. Defaults to false. |
Bot Mention | For message 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/select to listen to. Required for interaction triggers. |
Placeholder | A placeholder message shown in the channel that triggered the workflow while the workflow runs. Can be replaced by a response message from a Discord Send node. |
Output
The node outputs an array of JSON objects representing the event data received from Discord. Each output item contains fields relevant to the event type, including but not limited to:
content
: The message content (for message events).guild
: The guild/server ID where the event occurred.channelId
: The channel ID related to the event.userId
,userName
,userTag
: Information about the user involved.messageId
: The ID of the message (if applicable).presence
: User presence status (for presence update events).addedRoles
,removedRoles
: Arrays of role IDs added or removed (for role change events).interactionMessageId
: The message ID for interaction events.interactionValues
: Values selected or input during an interaction.userRoles
: Roles of the user at the time of the event.attachments
: Any attachments included in the message.
If the event includes binary data (e.g., attachments), it is included in the output under the attachments
property.
Dependencies
- Requires a valid Discord API credential with appropriate permissions.
- The Discord bot must be running and connected to the server.
- The node uses internal helper functions to load available channels and roles dynamically.
- The bot must have access to the specified channels and roles to listen for events.
- The node connects via IPC to a bot process named "bot" to receive real-time events.
Troubleshooting
- No channels listed: 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.
- Workflow not triggering: Check that the correct channels and roles are selected, and that the bot has necessary permissions.
- Regex pattern errors: Make sure your regex pattern is valid ECMAScript syntax.
- Missing required properties: For command triggers, ensure
name
,description
, and input field details are provided. - Bot mention not working: Confirm the bot is properly mentioned in the message and that the "Bot Mention" option is enabled.