Configure superuser identity
Grant administrators Lingchu-level privileges that follow them across platforms by mapping stable Lingchu UIDs to platform account IDs in the LINGCHU_SUPERUSERS environment variable.
Why UID-based identity
Section titled “Why UID-based identity”Lingchu permissions use stable UIDs and platform account bindings instead of treating a platform account ID as the only identity. A single UID can bind a QQ account, a Telegram account, and a Discord account, so one administrator is one identity regardless of which platform they connect from.
Set the environment variable
Section titled “Set the environment variable”Configure the superuser mapping as strict JSON inside LINGCHU_SUPERUSERS:
LINGCHU_SUPERUSERS='{"userA":{"qq":123,"telegram":"tg-id","discord":"discord-id"}}'The object key is the Lingchu UID. Each value maps platform IDs — qq, telegram, or discord — to that user’s account ID on the platform.
Verify the configuration
Section titled “Verify the configuration”- Start the bot:
uvx --from nb-cli nb.exe run. - If startup succeeds, the superuser mapping is valid.
- Send a privileged command (for example
菜单) from one of the bound platform accounts to confirm the identity resolves.
What superusers bypass
Section titled “What superusers bypass”SUPERUSERS always pass Lingchu command permission checks. Platform API restrictions and command-level safety checks still apply — a superuser cannot mute someone in a group where the bot itself lacks admin permissions.
Related pages
Section titled “Related pages”- Environment variables — full env var reference
- Configuration — runtime settings overview
- Permissions architecture — how permission checks are resolved