A Discord slash-command bot running on Cloudflare Workers via Discord's HTTP interactions endpoint (no gateway connection needed).
bun install
# Store the "Public Key" from the Discord developer portal as a Worker secret
bunx wrangler secret put DISCORD_PUBLIC_KEY
# Deploy the worker
bun run deployThen, in the Discord developer portal, set
General Information → Interactions Endpoint URL to your worker URL
(e.g. https://discord-bot.<your-subdomain>.workers.dev).
Commands are registered to a single guild. Run this whenever commands change:
cp .env.example .env # fill in DISCORD_TOKEN and GUILD_ID
bun run registercp .dev.vars.example .dev.vars # fill in DISCORD_PUBLIC_KEY
bun run dev