Skip to content

Configuration

Maxime Gauthier edited this page Apr 30, 2026 · 1 revision

Configuration

Create a .env file in the bot directory. The easiest starting point is .env.sample.

Required

DISCORD_BOT_TOKEN=my_discord_secret
OPENAI_API_KEY=my_openai_secret

When using PLUGINS=google_ai, GOOGLE_AI_API_KEY replaces the OpenAI key requirement.

AI

OPENAI_MODERATION_MODEL=omni-moderation-latest
OPENAI_REWRITE_MODEL=gpt-4.1-mini
GOOGLE_AI_MODEL=gemini-2.5-flash
HARASSMENT_CLASSIFIER_MODEL=gpt-4o-2024-08-06
HARASSMENT_CLASSIFIER_CACHE_TTL_SECONDS=3600
HARASSMENT_CLASSIFIER_RATE_LIMIT_PER_MINUTE=30

HARASSMENT_CLASSIFIER_MODEL defaults to GOOGLE_AI_MODEL when google_ai is the configured provider. Otherwise it defaults to the OpenAI classifier model.

Storage

No database plugin means in-memory moderation state:

PLUGINS=

Redis-backed core moderation state:

PLUGINS=redis
REDIS_URL=redis://localhost:6379/0

Postgres-backed core moderation state:

PLUGINS=postgres
DATABASE_URL=postgres://postgres:postgres@localhost:5432/openmodbot

Moderation

MODERATION_SHADOW_MODE=false
MODERATION_SHADOW_REWRITE=true
MODERATION_REVIEW_STORE_CONTENT=false
KARMA_AUTOMOD_THRESHOLD=-5
KARMA_AUTOMOD_ACTION=timeout
KARMA_TIMEOUT_SECONDS=3600

Supported automod actions are log_only, timeout, kick, and ban.

Review reposting is privacy-gated. By default, review entries do not store original message content. Set MODERATION_REVIEW_STORE_CONTENT=true to store original flagged content and allow moderators to repost it.

Admin Notifications

PLUGINS=admin_notifications
ADMIN_NOTIFICATION_CHANNEL_ID=123456789012345678
ADMIN_NOTIFICATION_AMBIGUOUS_MIN_SCORE=0.35
ADMIN_NOTIFICATION_AMBIGUOUS_MAX_SCORE=0.75
ADMIN_NOTIFICATION_SHADOW_MODE=true
ADMIN_NOTIFICATION_RATE_LIMIT_PER_MINUTE=10

ADMIN_NOTIFICATION_CHANNEL_ID is required when admin_notifications is enabled.

Logging

LOG_INVITE_URL=false
LOG_FORMAT=json
TELEMETRY_HASH_SALT=replace_with_random_secret

LOG_FORMAT=plain is useful for local development. Set TELEMETRY_HASH_SALT to a stable random secret for deployments.

Clone this wiki locally