Bit Discord Trigger icon

Bit Discord Trigger

Discord Trigger on message

Overview

This node acts as a trigger for Discord events, specifically listening to messages in selected text channels of a Discord server. It is designed to start workflows when certain message conditions are met, such as messages containing specific text patterns or mentions of the bot.

Common scenarios where this node is beneficial include:

  • Automating responses or actions based on user messages in Discord channels.
  • Monitoring specific channels for commands or keywords to trigger workflows.
  • Creating interactive bots that react to mentions or message content.

For example, you could use this node to trigger a workflow whenever a user sends a message starting with "!help" in a particular channel, enabling automated help responses.

Properties

Name Meaning
Listen To Names or IDs Select one or more text channels to listen to for triggering the workflow. If none are selected, the node listens to all available text channels. Channels can be chosen from a list or specified by their IDs using expressions. Requires valid credentials and a running bot.
From Role Names or IDs (Only for message type) Optionally specify roles to filter messages by sender's role. If no roles are selected, it listens to everyone (@everyone). Roles can be selected from a list or specified by IDs using expressions.
Trigger Type The type of event to listen for. Currently supports only "Message" which triggers when a message is sent in the selected channels.
Pattern (Only for message type) Defines how the message content is matched against the provided value. Options include: All messages, Bot Mention, Contains, Ends With, Equals, Regex, Starts With. The matching ignores mentions and trims whitespace before testing.
Value (Required for certain pattern types) The string or regex pattern to test against incoming messages. Used with pattern types like Equals, Starts With, Contains, Ends With, and Regex.
Case Sensitive (Only for message type) Whether the pattern matching should consider case sensitivity. Defaults to false (case-insensitive).
Message ID (Only for interaction type) The ID of a specific message with buttons or selects to listen to interactions from. Required if listening for interaction events.
Placeholder A message shown in the channel when the workflow is triggered, indicating the workflow is running. Animated dots show activity. This placeholder can be replaced by a response message from a Discord Send node.

Output

The node outputs JSON data representing the Discord message event that triggered the workflow. The output JSON object includes:

  • id: The unique identifier of the Discord message.
  • content: The text content of the message.
  • channelId: The ID of the channel where the message was sent.
  • authorId: The ID of the user who sent the message.
  • authorName: The username of the message author.
  • timestamp: The timestamp when the message was created.
  • listenValue: The value used for matching the message (from the node parameter).

No binary data output is indicated.

Dependencies

  • Requires a valid API authentication token credential for the Discord bot.
  • The bot must be running and connected via IPC (Inter-Process Communication) to listen for Discord events.
  • The node depends on internal helper functions to load available channels and roles dynamically.
  • Proper configuration of the Discord bot and permissions to read messages in the selected channels is necessary.

Troubleshooting

  • No token given: The node will not function without a valid API token credential. Ensure the credential is set up correctly.
  • Disconnected from IPC server: Indicates loss of connection to the bot process. Restarting the bot or checking IPC connectivity may resolve this.
  • Channels or roles not loading: May occur if the bot is not running or lacks permissions. Verify the bot status and permissions, then reopen the node modal to reload options.
  • Workflow not triggering: Check that the correct channels and roles are selected, and that the pattern and value parameters match the expected message content.
  • Expression errors: When specifying channel or role IDs via expressions, ensure the expressions are valid and return correct IDs.

Links and References

Discussion