Skip to content

NickTheDevOpsGuy/OmegaBot

Repository files navigation

OmegaBot Banner

codecov

OmegaBot

A self-hosted Discord bot for community servers, built with TypeScript, Discord.js v14, and SQLite. OmegaBot combines games, progression, moderation, utility commands, and AI-assisted chat in one modular codebase.

What It Does

  • Runs a broad /fun command hub with games, reminders, polls, quotes, weather, chat, and leaderboards.
  • Tracks progression with achievements, shared XP/levels, and daily quests.
  • Supports server utility features like FAQ, rules, welcome flows, starboard, suggestions, and status checks.
  • Lets members choose approved server roles with the /roles slash command.
  • Can search curated FAQ docs plus an optional Notion wiki via /wiki and /notion search.
  • Includes admin-focused health, metrics, backup, and troubleshooting support for self-hosted operation.
  • Stores persistent data in SQLite so state survives restarts.
  • Optional Web API — same backend can power a website (profiles, leaderboards, events, games). See Web platform and Setting up the website below.

Good Fit For

  • Community Discord servers that want games, utility, and moderation in one bot.
  • Self-hosters who want a feature-rich bot they can run themselves.
  • Developers looking for a larger Discord.js reference project with tests, docs, and operational tooling.

Not Trying To Be

  • A hosted SaaS bot.
  • A minimal starter template.
  • A clinical mental health product. Supportive chat exists, but it is not therapy.

Quick Start

git clone https://github.com/NickTheDevOpsGuy/OmegaBot.git
cd OmegaBot
npm install
cp .env.example .env  # Edit with your bot token
npm run build
npm run register
npm start

Docker (alternative):

cp .env.example .env   # Add your DISCORD_TOKEN, DISCORD_APP_ID, DISCORD_GUILD_ID
docker compose up -d

Optional — run the Web API (for a separate website using the same data):

npm run build
npm run api
# API listens on port 4000 (or set WEB_API_PORT). See docs/web-platform.md.

Feature Highlights

Community and games

  • Games: 8-ball, RPS, Tic Tac Toe, Trivia, Blackjack, Connect 4 (persistent multi-day, continue option), Hangman, Wordle, Slots (1/3/5 rows, rare random events), Darts, Chess, Memory, Higher/Lower, Dice, Coinflip, Choose, Would You Rather
  • Daily check-ins, shared XP/levels, and rotating daily quests
  • Achievements and per-game stats
  • Quotes, jokes, polls, reminders, and leaderboards

AI and utility

  • DM or mention-based chat plus /fun utility chat
  • Supportive chat modes, recaps, saved context, and gentle check-ins
  • GitHub and service status lookups
  • Curated docs lookup with /wiki and optional Notion-backed knowledge search
  • Weather, timezone-aware profile info, server info, and invite helpers

Server operations

  • FAQ, rules, welcome handling, starboard, self-assignable roles, and suggestions
  • /event — Create, join, list, and manage platform events (create, update, join, list, results)
  • /admin health, metrics, dashboard, DB backup, and DB integrity checks
  • Graceful shutdown, rate limiting, and resilient interaction recovery

Runtime Notes

  • Designed to run as a long-lived process
  • Safe to restart (state persisted in SQLite)
  • Background pollers never crash the process
  • Optional features auto-disable when misconfigured
  • Backup: Run npm run db:backup periodically, or copy data/omegabot.db; see Runbook
  • Runtime: Node.js 18+ is supported; Node 22 is recommended (LTS), and .nvmrc is set to 22
  • Web API: Optional. Run npm run api to start the HTTP API (default port 4000). Same database as the bot. See Web platform for setting up a website.

Documentation Map

Every Markdown file in docs/ is linked here (23 docs).

Start here

User-facing systems

Development and architecture

Product and roadmap docs

Index (all docs in docs/)

analytics · chat-and-llm · commands · dev-notes · faq · faq-admins · file-structure · games-and-ux-ideas · games-development · gameplay-improvements · grafana · i18n · improvements · progression · project-structure · recommendations · runbook · setup-discord · setup-env · setup-notion · transcripts · troubleshooting · web-platform


Tech Stack

  • Runtime: Node.js 18+ (22 LTS recommended; use nvm use or fnm use if you use a version manager)
  • Language: TypeScript 5.x
  • Discord: discord.js v14
  • Database: SQLite (better-sqlite3)
  • Logging: pino
  • Quality: ESLint, Prettier, Husky
  • Ops: Docker, Docker Compose, Dependabot, DevContainer

Code layout

Commands live under src/commands/ (core, games, social, other); services under src/services/ (core, discord, integrations, stores). Games use gameLogic.ts, ui.ts, and *Store.ts; the fun command is built from funSubcommands/ and routes via execute.ts. For a full walkthrough and an expandable file tree, see Project structure and File & folder tree.


Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run npm run lint && npm run typecheck
  5. Run npm test to verify tests pass
  6. Submit a pull request

For where things live in the repo, see Project structure, File & folder tree, and Development Notes.


Testing

npm test              # Run tests in watch mode
npm run test:run      # Run tests once
npm run test:coverage # Run with coverage report
npm run test:e2e      # E2E: start bot, wait for Discord ready (needs DISCORD_TOKEN, DISCORD_APP_ID)
npm run check:discord # Verify discord.js is v14.x
npm run db:check      # Verify SQLite database integrity
npm run db:backup     # Backup database to data/backups/
npm run db:seed       # Seed dev DB with sample FAQs/timezone (DATABASE_PATH=data/dev.db)
npm run dev:watch     # Run with hot reload (restarts on file change)
npm run api           # Start the optional Web API (see docs/web-platform.md)

35+ test files (200+ tests): unit tests (games, stores, services, config, roles, rate limiting, metrics) and integration tests (dice, slots, ping, admin, help, status, config, FAQ, rules, suggestion).


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

OmegaBot is your server’s all-in-one assistant organizing conversations, surfacing important information, and supporting projects with smart summaries, integrations, and helpful utilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages