Overview
This node triggers workflows based on various Discord events, enabling automation in response to activities within a Discord server. It listens for events such as new messages, message updates, thread creation or updates, commands, user interactions with buttons or selects, and user presence or role changes.
Common scenarios include:
- Automating responses or logging when specific messages are sent or updated.
- Triggering workflows when users join or leave the server.
- Reacting to user role changes or presence status updates.
- Handling custom slash commands or button/select interactions within Discord.
For example, you could use this node to automatically welcome new users, moderate messages containing certain 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 monitored. 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 event types like messages, threads, commands, user leaves, presence updates, nick updates, etc. |
| Trigger type | Type of Discord event to listen for. Options include: New Message, Message Update, New Thread, Thread Update, Command, Interaction (button/select), User joins, User leaves, User presence update, User nick updated, Role added/removed. |
| Which roles | For user role added/removed events, specify which roles to listen for. Defaults to listening to all roles if none selected. |
| Presence | For user presence update events, select the presence state 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. The message is tested after removing mentions and trimming whitespace. |
| Value | The string value to test against messages or threads according to the selected pattern. Required for message/thread event types. |
| Name | For command events, the name of the command to listen for (alphanumeric only). Required for command event type. |
| Description | For command events, a description of the command. Required for command event type. |
| Input field type | For command events, the type of input field expected: None, Text, Number, Integer, Boolean. Required for command event type. |
| Input field description | For command events 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 events with an input field, whether the input is required. Optional boolean. |
| Case Sensitive | For message or thread events, whether matching the value should be case sensitive. Defaults to false. |
| Bot Mention | For message or thread events, require that the message also mention the bot to trigger the workflow. Does not exclude other criteria. |
| Message ID | For interaction events, the ID of the message containing the button or select component to listen to. Required for interaction event type. |
| Placeholder | A message shown in the channel when the workflow is running, with animated dots indicating activity. 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 (for message-related events).channelId: The ID of the channel where the event occurred.userId,userName,userTag: Information about the user involved.messageId: The ID of the message (if applicable).presence: User presence status (for presence update events).nick: User nickname (if updated).addedRoles,removedRoles: Roles added or removed from a user.interactionMessageId: For interaction events, the message ID of the button/select.interactionValues: Values from the interaction components.userRoles: Current roles of the user.attachments: Any attachments included in the message.
If binary data were involved, it would be summarized here, but this node primarily deals with JSON event data.
Dependencies
- Requires a valid Discord API credential with a bot token.
- The bot must be running and connected to the Discord server.
- Access to the Discord server's text channels and roles is necessary.
- The node uses a WebSocket connection via an internal IPC mechanism to listen for events.
- Proper configuration of the Discord bot permissions and intents is assumed.
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.
- Authentication errors: Check that the provided API key credential is valid and has the necessary permissions.
- Workflow not triggering: Confirm the correct event type and filters (channels, roles, patterns) are configured.
- Regex pattern issues: Make sure the regex syntax is valid ECMAScript regex.
- Interaction message ID missing or incorrect: For interaction triggers, ensure the message ID corresponds to a persisted button/select component.