Configuration reference
Every setting the bot reads, where it lives, and what it does.
Settings #
| Name | Kind | Purpose |
|---|---|---|
CAD_BASE_URL | variable | Your docs site's address, such as https://docs.example.com. Use the site's root, not a page. |
DISCORD_CLIENT_ID | variable | Your Discord application's ID. |
DISCORD_PUBLIC_KEY | secret | Verifies that requests come from Discord. |
DISCORD_TOKEN | secret | Lets the bot keep its slash commands up to date. |
DISCORD_GUILD_ID | variable, optional | Registers commands to this one server instead of every server. Useful for testing, because server commands update instantly. |
BRAND_AVATAR_URL | variable, optional | Image shown beside the bot's name in reply footers. |
BRAND_SETTINGS | KV namespace | Stores each server's colour and a record of which commands are registered. Created automatically on first deploy. |
Variables live in vars in wrangler.jsonc. Secrets live in Cloudflare: set them with npx wrangler secret put NAME, or in the dashboard under Workers & Pages → your Worker → Settings → Variables and Secrets.
The template's wrangler.jsonc #
{
"name": "ctrlaltbot",
"main": "src/index.js",
"compatibility_date": "2026-09-13",
"compatibility_flags": ["global_fetch_strictly_public"],
"vars": {
"CAD_BASE_URL": "https://your-docs.example.com",
"DISCORD_CLIENT_ID": "YOUR_DISCORD_APPLICATION_ID"
},
"kv_namespaces": [{ "binding": "BRAND_SETTINGS" }],
"triggers": { "crons": ["0 * * * *"] },
"observability": { "enabled": true }
}nameis the Worker's name, which sets its URL. Keep it the same across deploys so the Interactions Endpoint URL in Discord stays valid.compatibility_flagslets the bot reach a docs site in the same Cloudflare account.triggersruns an hourly check that the slash commands match the bot's version.observabilitykeeps the bot's logs in the Cloudflare dashboard, for troubleshooting .
Slash command registration #
The bot registers its own commands with Discord. It checks whenever it starts up and handles its first request, and again every hour, and only contacts Discord when the commands have changed. This needs DISCORD_TOKEN.
Without the token, register the commands yourself from any machine with Node.js:
DISCORD_TOKEN=... DISCORD_CLIENT_ID=... npx ctrlaltbot-registerAdd DISCORD_GUILD_ID=... to register them to a single server.
Changing the code #
src/index.js in your bot's repository runs the published package:
export { default } from 'ctrlaltbot';To change how the bot behaves, contribute to ctrlaltbot rather than editing your copy. That way, your changes don't block future updates.