This is the operator-facing guide for starting, restarting, monitoring, and backing up OmegaBot.
Use this page for recurring maintenance tasks. Use Troubleshooting for failure diagnosis and Environment Configuration for config details.
- Start And Deploy
- Docker
- Restart
- Database
- Health And Monitoring
- Security
- Common Issues
- E2E Tests
- Optional Quality Checks
For a fresh setup or after pulling changes:
npm ci
npm run build
npm run register
npm startUse npm run register when slash command definitions changed or when you are setting up the bot in a new guild.
If you only changed normal runtime code, this is usually enough:
npm run build
npm startnpm run register needs DISCORD_TOKEN and DISCORD_APP_ID to be configured first. See Environment Configuration.
To run the optional HTTP API for profiles, leaderboards, events, posts, and auth:
npm run apior:
node dist/web/server.jsThis API uses the same database as the bot. See Web platform for details.
Basic Docker startup:
cp .env.example .env
# Edit .env and set DISCORD_TOKEN, DISCORD_APP_ID, DISCORD_GUILD_ID
docker compose up -dNotes:
- data persists in the
omegabot_datavolume - logs can be tailed with
docker compose logs -f bot - health and metrics are exposed when
METRICS_PORTis enabled in.env
When restarting the bot:
- Stop the process or container.
- Let it shut down cleanly so Discord and SQLite are closed properly.
- Start it again with your normal runtime command or process manager.
Examples:
npm startor:
node dist/bot.jsState is persisted in SQLite, so a normal restart should not lose bot data.
- default path:
data/omegabot.db - override with
DATABASE_PATHin.env
Create a backup with:
npm run db:backupor:
scripts/backup-db.shBehavior:
- backups go to
data/backups/by default BACKUP_KEEPcontrols how many backups are retained- the script is safe to run while the bot is up because SQLite supports concurrent reads
- if
sqlite3is installed, the backup script also runs an integrity check
Run:
npm run db:checkUse this when you suspect corruption, migration drift, or startup issues tied to SQLite.
Schema changes live in migrations/*.sql and are applied automatically on startup.
Use:
/admin health
This gives admins a quick summary of:
- database health
- environment/config summary
- interaction error counts
- optional external integration reachability
If you set METRICS_PORT, OmegaBot exposes:
GET /orGET /dashboard- lightweight admin dashboardGET /health- JSON health summaryGET /metrics- Prometheus scrape endpoint
If ADMIN_DASHBOARD_TOKEN is set, / and /dashboard require ?token=<value>.
- default runtime logging is
info - use
LOG_LEVEL=debugtemporarily when diagnosing issues
- never commit
.env - never log secrets such as Discord tokens or API keys
- protect
ADMIN_DASHBOARD_TOKENif you expose monitoring endpoints publicly - prefer least-privilege config for optional integrations and admin roles
- "Interaction failed" - see Troubleshooting
- missing optional features - check
.envand Environment Configuration - rate limit confusion - see Command Reference
Run:
npm run test:e2eThis starts the bot, waits for Discord ready, and shuts it down again.
Requirements:
DISCORD_TOKENDISCORD_APP_ID
The E2E flow uses an in-memory DB and is mainly intended as a connectivity smoke test.
Run:
npm run test:coverageThe repo's precheck flow covers formatting, linting, TypeScript, and tests.
- normal
git pushruns pre-push checks [skip-precheck]in the most recent commit message skips that hook when you intentionally need to bypass it