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 uses a hybrid permission system that supports three distinct modes. Each server can run a different mode, so you can pick the level of granularity that suits your community. The mode you choose determines how the bot decides whether a member is allowed to run a command or trigger a moderation action.

The three modes

Discord mode

Relies entirely on Discord’s native permissions. The simplest option and the default.

Levels mode

Assigns integer permission levels (0–100) to users and roles, each with a predefined set of allowed commands.

Advanced mode

Grants fine-grained permissions through database entries that describe exactly what each role or user can do.

Discord-based mode

In Discord mode, SudoBot checks whether the member has the Discord permission that corresponds to the command they are attempting to use. For example, running ban requires the BanMembers Discord permission. A member satisfies this check if they are the server owner, an administrator, or have a role that explicitly grants the required permission. This mode is enabled by default and requires no additional configuration beyond setting the permissions.mode value.
Discord mode is the easiest to set up but gives the least control. If you want moderators to be able to use only some bot commands without granting them broad Discord permissions, consider switching to levels or advanced mode.

Level-based mode

Level-based mode replaces Discord permission checks with an integer scale from 0 to 100. You assign a level to users and roles, and each level unlocks a predefined set of bot commands and actions.
  • Level 0 means no special permissions (regular member).
  • Level 100 grants access to everything.
  • Levels in between provide a tiered structure (for example, level 50 for moderators and level 75 for senior staff).
You can customize which commands each level unlocks by adding entries to the permission_levels table in the bot’s database.
Do not add multiple rows with the same level number, and do not use values outside the 0–100 range. Either mistake results in undefined behavior.

Advanced mode (permission roles)

Advanced mode gives you the highest degree of control. You create entries in the permission_roles database table that specify exactly which users or roles receive which permissions. The bot merges these entries with Discord’s own permission checks at runtime, making the full system extremely flexible. Advanced mode is suitable when your server has a complex staff hierarchy where different moderators need access to different subsets of commands, and neither Discord permissions nor a simple level scale is expressive enough. Each permission role entry can have a human-readable name. The name does not affect the bot’s behavior — it is only for your own organization.

Configuring the permission mode

To change the permission mode for a guild, open config/config.json and set the permissions.mode property inside that guild’s configuration object.
{
  "YOUR_GUILD_ID": {
    "permissions": {
      "mode": "discord"
    }
  }
}
Restart the bot after saving the file for the new mode to take effect.

Accepted values for permissions.mode

ValueMode
"discord"Discord-based (default)
"levels"Level-based
"advanced"Permission roles / overwrites

Auto-moderation bypass

Regardless of the permission mode you choose, the permission system also controls which members are exempt from automatic moderation (anti-spam, raid protection, etc.). Members who pass the auto-moderation bypass check are not subject to automated actions even if they trigger a rule. Configure bypass criteria in your permission mode’s settings or by assigning an appropriate permission level or role.

Build docs developers (and LLMs) love