Overview
This node acts as a trigger for various Discord events, enabling workflows to start based on activities occurring within a Discord server. It listens to events such as messages sent in channels, reactions added or removed, commands issued, user interactions with buttons or selects, and user presence or role changes.
Common scenarios where this node is beneficial include:
- Automating responses or actions when specific messages or commands are detected.
- Tracking user engagement through reactions or interactions.
- Monitoring user join/leave events to update databases or send welcome/goodbye messages.
- Reacting to role changes or presence updates for dynamic access control or notifications.
For example, you could use this node to trigger a workflow that welcomes new users when they join the server, or to listen for a custom command that triggers a bot response.
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 a running bot. |
| From roles | Optionally select roles to filter events by user roles. If none selected, it listens to everyone (@everyone). Applicable for message, command, user leaves, presence update, role added/removed, interaction, and reaction types. |
| Trigger type | Type of event to listen to. Options: Message, Reaction, Command, Interaction, User joins, User leaves, User presence update, User role added, User role removed. |
| Which roles | For user role added/removed events, select which roles to listen for. Defaults to @everyone if none selected. |
| Presence | For user presence update events, specify which presence status change to listen for (any, online, offline, do not disturb, idle). |
| Pattern | For message events, how to match the message content: Equals, Starts with, Contains, Ends with, Regex. |
| Value | The string value to test against messages according to the selected pattern. |
| Name | For command events, the name of the command to listen for (alphanumeric only). |
| Description | For command events, description of the command. |
| Input field type | For command events, type of input field expected: None, Text, Number, Integer, Boolean. |
| Input field description | For command events with an input field, description of the input field. |
| Input field required | For command events with an input field, whether the input is required. |
| Case Sensitive | For message events, whether matching should be case sensitive. |
| Bot Mention | For message events, require the message to mention the bot to trigger the workflow. |
| Message ID | For interaction events, the message ID of the button/select to listen to. |
| Placeholder | A placeholder message shown in the channel when the workflow is triggered. Can be replaced by a response message from a Discord Send node. |
| Debug Mode | Enable logging of Discord events and API calls to the console for debugging purposes. |
| Emojis | For reaction events, comma-separated list of emojis to monitor. If empty, all emojis are monitored. |
| Type d'événement | For reaction events, specify which reaction events to listen for: all, add only, or remove only. |
Output
The node outputs a JSON object containing detailed information about the triggered Discord event. The output fields may include:
content: The message content (for message events).channelId: The ID of the channel where the event occurred.userId: The ID of the user involved in the event.userName: The username of the user.userTag: The user's tag (username#discriminator).messageId: The ID of the message related to the event.presence: User presence status (for presence update events).addedRoles: Roles added to the user (for role added events).removedRoles: Roles removed from the user (for role removed events).interactionMessageId: The message ID for interaction events.interactionValues: Values from the interaction (e.g., selected options).userRoles: Current roles of the user.attachments: Any attachments included in the message.reactionEmoji: The emoji involved in a reaction event.reactionAction: The action taken on the reaction (added or removed).
If the node handles binary data (e.g., attachments), it includes them in the output accordingly.
Dependencies
- Requires a valid Discord API credential with appropriate permissions.
- The Discord bot must be running and connected.
- The node uses an internal IPC connection to communicate with the bot process.
- Channels and roles are dynamically loaded via helper methods requiring proper API access.
- Environment must allow network communication with Discord's API.
Troubleshooting
- No channels listed: Ensure your credentials are set correctly, the bot is running, and at least one text channel exists. 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 issues: Make sure your regex is valid ECMAScript syntax.
- Debug mode: Enable debug mode to log events and API calls to the console for troubleshooting.
- Missing or invalid credentials: The node requires a valid API key credential; ensure it is configured properly.