Overview
This node listens to various Discord events and triggers workflows based on those events. It supports a wide range of Discord events such as message creation, direct messages, mentions (bot, user, role), message updates and deletions, reactions, member joins/leaves/updates, role and channel changes, bans, interactions, voice state changes, and typing starts. Users can filter events by guild, channel, user, message content, and more. This node is useful for automating responses, monitoring server activity, or integrating Discord events into other systems.
Use Case Examples
- Trigger a workflow when a new message is created in a specific channel.
- Trigger a workflow when the bot is mentioned in any message.
- Trigger a workflow when a user with a specific ID is mentioned.
- Trigger a workflow when a member joins or leaves a guild.
Properties
| Name | Meaning |
|---|---|
| Event | The specific Discord event to listen for, such as message creation, direct messages, mentions, member updates, role changes, etc. |
| Mention User IDs | Comma-separated list of user IDs to watch for mentions (shown only when event is 'User Mentioned'). |
| Mention Role IDs | Comma-separated list of role IDs to watch for mentions (shown only when event is 'Role Mentioned'). |
| Filters | Collection of filters to narrow down the events by guild ID, channel ID, user ID, ignoring bots, message content, message start text, and DM sender user IDs. |
Output
JSON
id- ID of the event entity (e.g., message ID, user ID, role ID)content- Content of the message (if applicable)channelId- ID of the channel where the event occurredguildId- ID of the guild where the event occurred (if applicable)userId- ID of the user related to the eventauthorBot- Boolean indicating if the author is a botusername- Username of the user related to the eventcreatedTimestamp- Timestamp when the event occurredisDM- Boolean indicating if the event is a direct messagechannelType- Type of the channel where the event occurredattachments- List of attachments related to the event (if any)mentions- List of users mentioned in the message (if applicable)mentionedRoles- List of roles mentioned in the message (if applicable)mentionsBot- Boolean indicating if the bot was mentioned (if applicable)oldContent- Old content of the message before update (for messageUpdate event)newContent- New content of the message after update (for messageUpdate event)editedTimestamp- Timestamp when the message was edited (for messageUpdate event)emoji- Emoji used in reaction eventsemojiId- ID of the emoji used in reaction eventsroleName- Name of the role (for role events)color- Color of the role (for roleCreate and roleUpdate events)permissions- Permissions array of the role (for roleCreate and roleUpdate events)oldName- Old name of the role or channel before updatenewName- New name of the role or channel after updateinteractionId- ID of the interaction (for interactionCreate event)interactionType- Type of the interaction (for interactionCreate event)muted- Whether the user is muted (for voiceStateUpdate event)deafened- Whether the user is deafened (for voiceStateUpdate event)selfMuted- Whether the user muted themselves (for voiceStateUpdate event)selfDeafened- Whether the user deafened themselves (for voiceStateUpdate event)startedTimestamp- Timestamp when typing started (for typingStart event)
Dependencies
- Discord API
- An API key credential for Discord bot authentication
Troubleshooting
- Common issues include invalid or expired Discord bot token, insufficient bot permissions to listen to certain events, and incorrect filter settings that prevent events from triggering.
- Error messages related to authentication failures can be resolved by verifying the bot token and ensuring the bot is added to the Discord server with appropriate permissions.
- If no events trigger, check the filter settings to ensure they are not too restrictive or conflicting.
- Ensure the Discord bot has the necessary intents enabled in the Discord Developer Portal to receive the selected events.
Links
- discord.js Client Documentation - Official documentation for the Discord.js Client used to interact with Discord API.
- Discord Gateway Intents - Information about Discord Gateway Intents required to receive specific events.