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 community, such as welcoming new users, moderating content, responding to commands, or tracking user status.
Practical examples:
- Trigger a workflow when a user sends a message starting with "!help" to provide automated assistance.
- Start a workflow when a user joins the server to send a welcome message.
- React to button interactions in messages to handle polls or confirmations.
- Monitor role additions/removals to update user permissions or notify admins.
Properties
| Name | Meaning |
|---|---|
| Listen to | Select one or more text channels to listen for triggering events. If none selected, all channels are monitored. Requires valid credentials and bot running with access to at least one text channel. |
| From roles | (For certain event types) Filter events by user roles. If none selected, listens to everyone (@everyone). |
| Trigger type | Type of Discord event to listen for: Message, Command, Interaction, User joins, User leaves, User presence update, User role added, User role removed. |
| Which roles | (For userRoleAdded and userRoleRemoved) Specify which roles to listen for role changes. Defaults to @everyone if none selected. |
| Presence | (For userPresenceUpdate) Specify which presence status changes to listen for: any change, online, offline, do not disturb, idle. |
| Pattern | (For message trigger) How to match the message content: equals, starts with, contains, ends with, regex. The message is tested after removing mentions and trimming whitespace. |
| Value | (For message trigger) The string or pattern to test against messages. Required for message triggers. |
| Name | (For command trigger) The name of the command to listen for. Must be alphanumeric. Required for command triggers. |
| Description | (For command trigger) Description of the command. Required for command triggers. |
| Input field type | (For command trigger) Type of input field for the command: None, Text, Number, Integer, Boolean. |
| Input field description | (For command trigger with input field) Description of the input field. Required if input field type is not None. |
| Input field required | (For command trigger with input field) Whether the input field is required. |
| Case Sensitive | (For message trigger) Whether message matching should be case sensitive. Defaults to false. |
| Bot Mention | (For message trigger) Whether the message must mention the bot to trigger. Does not exclude other criteria. |
| Message ID | (For interaction trigger) The message ID of the button/select component to listen to. Required for interaction triggers. |
| Placeholder | A message shown in the channel that triggered the workflow indicating 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 details that triggered the workflow. The output JSON includes fields such as:
content: The message content (if applicable).channelId: The ID of the channel where the event occurred.userId: The ID of the user involved.userName: The username of the user.userTag: The user's tag (username#discriminator).messageId: The ID of the message (if applicable).presence: The user's presence status (if applicable).addedRoles: Roles added to the user (if applicable).removedRoles: Roles removed from the user (if applicable).interactionMessageId: The message ID related to an interaction (if applicable).interactionValues: Values from the interaction components (if applicable).userRoles: The roles of the user.attachments: Any attachments included in the message.
If binary data were supported, it would represent files or media attached to messages, but this node primarily outputs JSON event data.
Dependencies
- Requires a valid Discord API credential with appropriate permissions.
- The Discord bot must be running and connected to the server.
- Access to the Discord server's text channels and roles is necessary.
- The node uses an internal IPC mechanism to communicate with the bot process.
- Environment must allow webhook reception for event delivery.
Troubleshooting
- No channels listed: Ensure the bot is running and has permission to view channels. Close and reopen the configuration modal to reload channels.
- Commands not triggering: Verify the command name is alphanumeric and the trigger node is active. Restart the Discord client if commands do not appear.
- Workflow not triggering: Confirm the bot has the necessary permissions and the correct channels/roles are selected.
- Regex pattern errors: Invalid regex patterns can cause failures; verify the pattern syntax.
- Missing required properties: For command triggers, ensure name and description are provided; for interaction triggers, provide the message ID.
- Bot mention not working: Make sure the bot is correctly mentioned in the message if the "Bot Mention" option is enabled.