Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/onesoft-sudo/sudobot/llms.txt

Use this file to discover all available pages before exploring further.

SudoBot ships with several independent auto-moderation systems that run in the background and act on rule-breaking behavior without requiring manual moderator intervention. Each system is configured inside your guild’s entry in config/config.json and can be enabled or disabled independently.
All auto-moderation systems skip members who have been granted bypass permissions via the permission system. Bots are also excluded from most checks.

Anti-Spam

The Anti-Spam system (SpamModerationService) monitors messages from each user and triggers when they exceed a configured message-per-second threshold. When triggered, the bot applies a configurable moderation action such as a mute or a warn.
1

Enable Anti-Spam in config.json

Add or update the antispam key inside your guild’s configuration object:
{
  "YOUR_GUILD_ID": {
    "antispam": {
      "enabled": true,
      "limit": 5,
      "timeframe": 5000,
      "actions": [
        { "type": "mute", "duration": "10m" },
        { "type": "delete_message" }
      ]
    }
  }
}
2

Configure the threshold

  • limit — the maximum number of messages a user may send within the timeframe.
  • timeframe — the sliding window in milliseconds during which messages are counted.
3

Set the actions

The actions array accepts any ModerationAction objects. Common choices are delete_message, warn, mute, and kick.

Raid protection

The Raid Protection system (RaidProtectionService) watches for sudden spikes in new member joins. When the join rate exceeds the configured threshold within a set timeframe, the system locks down the server or takes another configured action.
1

Enable Raid Protection in config.json

{
  "YOUR_GUILD_ID": {
    "raid_protection": {
      "enabled": true,
      "threshold": 10,
      "timeframe": 10000,
      "action": "lock",
      "channel": "CHANNEL_ID"
    }
  }
}
2

Configure the threshold

  • threshold — the number of joins that triggers the protection.
  • timeframe — the window in milliseconds in which joins are counted.
3

Choose an action

The action field controls what happens when the threshold is hit. Supported values include lock (locks all channels) and antijoin (enables the Anti-Join system automatically).
Raid protection resets automatically after the timeframe passes with no new joins. Manually unlock channels with /unlockall once the raid is over.

AI auto-moderation

The AI Auto-Moderation system (AIAutoModeration) uses the Google Perspective API to analyze message content for toxicity, insults, threats, and other harmful attributes. When a message’s score exceeds a configured threshold, the bot applies the configured actions.
1

Set your Perspective API key

Add your API key to the bot’s environment:
PERSPECTIVE_API_TOKEN=your_api_key_here
2

Enable AI moderation via a rule

AI moderation is triggered through the ai_scan rule type inside rule_moderation. See Moderation Rules for full details.
{
  "YOUR_GUILD_ID": {
    "rule_moderation": {
      "enabled": true,
      "rules": [
        {
          "type": "ai_scan",
          "toxicity_threshold": 0.75,
          "insult_threshold": 0.8,
          "actions": [
            { "type": "warn", "reason": "Automatic: Toxic message detected" },
            { "type": "delete_message" }
          ]
        }
      ]
    }
  }
}
The AI system applies internal rate limiting (queue size of 10) to stay within Perspective API quotas. Messages that exceed the queue are dropped silently rather than causing errors.

Anti-Join

The Anti-Join system (AntiMemberJoinService) automatically kicks or bans every new member that joins the server. It is useful when you need to temporarily close the server to new members during an ongoing raid or other emergency.
{
  "YOUR_GUILD_ID": {
    "anti_member_join": {
      "enabled": true,
      "behavior": "kick",
      "ignore_bots": true,
      "custom_reason": "This server is temporarily closed to new members."
    }
  }
}
OptionTypeDescription
behavior"kick" | "ban"What to do with new joins.
ignore_botsbooleanSkip bot accounts when they join.
custom_reasonstringReason shown in the infraction and DM.
ban_durationstringDuration string for temp-bans (e.g. "1d", "12h"). Only used when behavior is "ban".

Verification system

The Verification system (VerificationService) gates new members behind a challenge before they can access the server. Verified members receive a configured role; unverified members are held in a restricted state until they pass or the entry expires.
1

Configure verification in config.json

{
  "YOUR_GUILD_ID": {
    "member_verification": {
      "enabled": true,
      "method": "button",
      "verified_role": "ROLE_ID",
      "unverified_role": "ROLE_ID",
      "channel": "CHANNEL_ID"
    }
  }
}
2

Choose a verification method

The method field controls how a new member proves they are human. Available methods include button (click a button), and other methods depending on your bot build. Check VerificationMethod in the source for the full list.
3

Set role IDs

  • verified_role — the role granted once a member passes verification.
  • unverified_role — the role assigned on join that restricts access until verification completes.
Expired verification entries are cleaned up automatically via VerificationExpiredQueue. Make sure the bot’s queue worker is running to avoid stale records accumulating in the database.

Build docs developers (and LLMs) love