Lingchu Bot documentation is now live — check it out!
Lingchu Bot

Environment Variables

Lingchu Bot uses NoneBot2's environment variable system. Copy .env.example to .env and adjust values for your environment.

The project provides a cross-platform setup script (./scripts/setup.sh) that automatically generates .env, .env.development, .env.test, and .env.production from templates. You can also create these files manually.

Server settings

VariableDefaultDescription
ENVIRONMENTprodRuntime environment (prod or dev)
HOST0.0.0.0FastAPI listen address
PORT8080FastAPI listen port
DRIVER~fastapi+~httpx+~websocketsNoneBot driver stack; prefix ~ enables default adapter config

Command settings

VariableDefaultDescription
COMMAND_START["/", ""]Command start prefixes; empty string allows no-prefix commands
COMMAND_SEP[".", " "]Command segment separators

Logging and API docs

VariableDefaultDescription
LOG_LEVELINFOPython logging level
FASTAPI_OPENAPI_URL/openapi.jsonOpenAPI schema path; set to empty string to disable
FASTAPI_DOCS_URL/docsSwagger UI path; disable in production
FASTAPI_REDOC_URL/redocReDoc documentation path; disable in production

Database settings

VariableDefaultDescription
ALEMBIC_STARTUP_CHECKfalseSet to true in production to enforce schema migration checks on startup
SQLALCHEMY_DATABASE_URL(unset)SQLAlchemy database URL for multi-database testing; supports six backends (SQLite / PostgreSQL / MySQL / MariaDB / Oracle / SQL Server); unset uses default SQLite

Superuser settings

VariableDefaultDescription
LINGCHU_SUPERUSERS(unset)JSON object mapping Lingchu UIDs to platform accounts; see Superuser Identity
SUPERUSERS(unset)NoneBot native fallback; used when LINGCHU_SUPERUSERS is missing or null

See Superuser Identity for detailed configuration.

Boolean format

NoneBot configuration files only accept standard JSON lowercase true / false. Using True / False will raise a configuration error at startup.

Last updated on

On this page