Discord Trigger icon

Discord Trigger

Listen to Discord events

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

  1. Trigger a workflow when a new message is created in a specific channel.
  2. Trigger a workflow when the bot is mentioned in any message.
  3. Trigger a workflow when a user with a specific ID is mentioned.
  4. 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 occurred
  • guildId - ID of the guild where the event occurred (if applicable)
  • userId - ID of the user related to the event
  • authorBot - Boolean indicating if the author is a bot
  • username - Username of the user related to the event
  • createdTimestamp - Timestamp when the event occurred
  • isDM - Boolean indicating if the event is a direct message
  • channelType - Type of the channel where the event occurred
  • attachments - 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 events
  • emojiId - ID of the emoji used in reaction events
  • roleName - 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 update
  • newName - New name of the role or channel after update
  • interactionId - 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

Discussion