Discord Tools icon

Discord Tools

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

Overview

This node provides a utility tool for Discord, specifically focusing on moderation tasks such as detecting spam messages in a Discord server channel. It connects to the Discord API using a bot token, fetches messages from a specified channel within a guild (server), and identifies messages that are potentially spam based on criteria like message length or number of lines. This is useful for server moderators to automatically flag or review suspicious messages that may disrupt the community.

Use Case Examples

  1. A Discord server moderator wants to automatically detect and review messages that are unusually long or contain many lines, which are common indicators of spam or disruptive content.
  2. A community manager uses this node to scan recent messages in a channel to identify potential spam messages for further action or automated moderation workflows.

Properties

Name Meaning
Guild ID The ID of the Discord server (guild) where the moderation operation will be performed.
Channel ID The ID of the specific channel within the guild to fetch and analyze messages for spam detection.
Additional Options Optional parameters to customize the message fetching and filtering process, such as including bot messages, filtering by message IDs, case sensitivity, exact text matching, and audit log filters.

Output

JSON

  • id - The ID of the detected spam message.
  • content - A snippet (up to 100 characters) of the spam message content.
  • author
    • id - The ID of the author who sent the spam message.
    • username - The username of the author who sent the spam message.
  • reason - The reason why the message was flagged as spam (e.g., long message or many lines).

Dependencies

  • Discord API accessed via a bot token credential

Troubleshooting

  • Ensure the bot token credential is valid and has the necessary permissions to access the specified guild and channel.
  • Verify that the Guild ID and Channel ID are correct and that the bot has access to the channel.
  • The node throws errors if the channel is not text-based or if the channel does not belong to the specified guild.
  • If no messages are found or no spam messages are detected, the output will be an empty array, which is expected behavior.

Links

Discussion