Discord Tools icon

Discord Tools

Discord utility tools - Message fetching, user info, and more

Overview

This node operation 'Get Mentions' under the 'Message' resource fetches messages from a specified Discord channel that mention a particular user. It allows filtering by the number of messages to fetch and supports options such as including bot messages, and fetching messages before or after a specific message ID. This is useful for monitoring user mentions in a Discord server channel, for example, to track conversations involving a specific user or to automate responses to mentions.

Use Case Examples

  1. Fetch the last 50 messages mentioning a user in a specific channel to analyze user engagement.
  2. Monitor mentions of a user in a channel to trigger notifications or logging in an external system.

Properties

Name Meaning
Guild ID The ID of the Discord server (guild) where the channel is located.
Channel ID The ID of the channel from which to fetch messages.
Limit The maximum number of messages to fetch (up to 100).
Mentioned User ID The user ID to find mentions of in the messages.
Additional Options Optional parameters to refine the search, including whether to include bot messages, message ID boundaries (before/after), case sensitivity, exact match, and audit log filters.

Output

JSON

  • id - The ID of the message mentioning the user.
  • content - The content text of the message.
  • author
    • id - The ID of the author who sent the message.
    • username - The username of the author who sent the message.
  • channelId - The ID of the channel where the message was sent.
  • createdTimestamp - The timestamp when the message was created.
  • mentionedUsers
    • ``
      * id - The IDs of users mentioned in the message.
      * username - The usernames of users mentioned in the message.

Dependencies

  • Discord API accessed via discord.js library
  • An API key credential for Discord bot authentication

Troubleshooting

  • Ensure the bot has access to the specified guild and channel; otherwise, channel fetch operations will fail with errors indicating missing access or invalid IDs.
  • The limit parameter must not exceed 100 due to Discord API restrictions; exceeding this may cause errors or truncated results.
  • If no messages mention the specified user, the output will indicate zero messages found, which is expected behavior.
  • Invalid or missing user ID for mentions will result in no matches or errors.
  • Bot token must be valid and have appropriate permissions to read messages and mentions in the channel.

Links

Discussion