SudoBot reads its runtime configuration from environment variables, which you typically store in aDocumentation 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.
.env file at the project root. Required variables must be present or the bot will refuse to start. Optional variables unlock additional features or override default behavior. Never commit your .env file to version control — it contains secrets.
Example .env file
Required variables
These variables must be set before starting the bot.Your Discord bot token from the Discord Developer Portal. This authenticates the bot with the Discord API.Sensitive — do not commit or share this value.
The application (client) ID of your Discord bot, found in the Discord Developer Portal. Used for OAuth2 flows and slash command registration.
The OAuth2 client secret for your Discord application. Required for OAuth2-based authentication.Sensitive — do not commit or share this value.
The Discord guild (server) ID used as your home guild. The bot registers development slash commands here, searches for custom emojis here, and sends error reports to this guild.
PostgreSQL connection URL in the format
postgresql://username:password@hostname:port/database. SudoBot uses this to connect to its database for storing settings, infractions, and other persistent data.Sensitive — this contains your database credentials.Secret key used to sign and verify JWT tokens for the bot’s internal API authentication. Generate a strong random value — for example, on Linux/macOS:Sensitive — treat this like a password.
Server and runtime variables
The TCP port the bot’s built-in API server listens on. Must be a valid integer. Defaults to
4000.The root directory where SudoBot stores its persistent data, including
config/config.json, config/system.json, logs, and extension files. If not set, the bot falls back to a default location relative to the project root. Set this to a directory outside the repository to prevent your configuration from being overwritten by Git updates.Sets the application environment. Accepted values:
development, production, dev, prod, test. Setting this to development or dev enables additional debug logging and development-specific behaviors.An alternative way to set the SudoBot environment. Accepted values:
dev, prod. Takes precedence in some code paths over NODE_ENV.Set to
1 to enable debug mode, or 0 to disable it. When enabled, the bot produces more verbose log output.Set to any non-empty value to suppress standard log output. Useful for production environments that manage logs through a separate logging system.
Custom path to the directory where SudoBot looks for installed extensions. Overrides the default location under
SUDO_PREFIX.Path to the Unix socket file used for inter-process communication between the bot and the log server. Defaults to a path under
SUDO_PREFIX.A space- or comma-separated list of Discord gateway intents to enable. When not set, SudoBot uses a default set of intents.
Custom
User-Agent header sent with outgoing HTTP requests made by the bot. Set to the string null to omit the User-Agent header entirely.Set to
true to enable private bot mode, which restricts the bot to only operate in guilds it has been explicitly configured for.Set to any non-empty value to skip auto-generating JSON schema files for
config.json and system.json at startup.Web and OAuth2 variables
The base URL of the bot’s API server, used when generating absolute URLs in API responses. For example:
https://api.example.com.The URL of the SudoBot web frontend. Used for generating links sent to users during verification flows.
URL template for the guild member verification page on the frontend. SudoBot substitutes guild and token parameters into this URL and sends it to users who need to verify.
The redirect URI registered in the Discord Developer Portal for the standard OAuth2 flow. Must exactly match the URI configured in the portal.
The redirect URI for the relying-party OAuth2 flow (used by the verification system).
A shared secret between the bot API and the web frontend, used to authenticate certain internal API requests.Sensitive — do not commit or share this value.
The publicly accessible URL where modification logs or audit exports are served.
Set to
1 to suppress the notice that displays the MODIFICATIONS_PUBLIC_URL in bot output.Authentication integration variables
GitHub OAuth2 application client ID. Required if you enable GitHub-based login in the SudoBot web frontend.
GitHub OAuth2 application client secret.Sensitive — do not commit or share this value.
Google OAuth2 application client ID. Required if you enable Google-based login in the SudoBot web frontend.
Google OAuth2 application client secret.Sensitive — do not commit or share this value.
Google reCAPTCHA v2 or v3 secret key. Used to validate CAPTCHA responses during member verification.Sensitive — do not commit or share this value.
Cloudflare Turnstile secret key. An alternative to reCAPTCHA for bot-detection during member verification.Sensitive — do not commit or share this value.
URL for a two-factor authentication service integrated with the bot’s login system.
Third-party API keys
API key from API Ninjas. Enables the joke command.
API key for Google’s Perspective API. Used by AI-based auto-moderation to score message toxicity.Sensitive — do not commit or share this value.
API key for ProxyCheck.io. Used during member verification to detect VPN and proxy connections.
API key for Paxmod, a third-party moderation data service used by SudoBot.
Base URL for the system-level external API that SudoBot may call for extended functionality.
AI and content moderation variables
URL to a custom NSFW.js TensorFlow model. When set, SudoBot uses this model for image content classification instead of the bundled default.
The input image size (in pixels, as an integer string) expected by the NSFWJS model. Required when using a custom model that differs from the default image dimensions.
Webhook and notification variables
A Discord webhook URL where the bot sends uncaught error reports. Useful for monitoring production deployments.
A Discord webhook URL where the bot forwards direct message logs.
Discord channel ID where the bot uploads periodic data backups.
Storage backend identifier or path for backup data. Controls where the bot writes backup files.
Discord channel ID where the bot posts data deletion request notifications.
System shell variables
Authentication key for the system shell API endpoint. Required to use the remote shell execution feature.Sensitive — do not commit or share this value.
TCP port for the shell execution stream server. Must be a valid integer.
Emoji variables
Controls how the bot resolves custom emoji. Accepted values:
both— searches the home guild first, then falls back to application emojishome_guild— uses only the home guild’s emojisapplication— uses only application-level emojis
emoji_resolve_strategy in system.json.