Back FoxCode
code

Project

Cerberus BOT

Multi-purpose Discord bot built with discord.js v13

JavaScript

Date

June 2021

Status

Archived

Cerberus BOT is a multi-purpose Discord bot I built on top of discord.js v13 as a way to learn the Discord API and play with the modular command-handler pattern. It's organized around five command categories - Fun, Games, Moderation, Music, and Utility - each loaded dynamically from its own folder by a custom command handler.

The command set is intentionally eclectic, because the goal was to cover as many parts of the Discord API as possible:

  • Fun - dice rolls, coin flips, random number generation, an Urban Dictionary lookup, and a calculator that evaluates expressions in chat
  • Games - small text-based games like a Who Wants to Be a Millionaire clone and a drinking game
  • Moderation - warning system that persists user infractions per-server
  • Music - Spotify integration for "now playing" lookups
  • Utility - server config commands, message clearing, COVID-19 stats lookup, daily reminders, scheduled notifications, ping/latency checks, and a custom echo

State is persisted to a local SQLite database (via quick.db / json.sqlite), which keeps things zero-config: no external database server, no migrations, just a file that grows with the bot.

Architecturally, the bot uses a handler-based loader: src/handlers/ walks each command and event folder at startup, registers everything dynamically, and listens for interactions. Adding a new command means dropping a single .js file into the right folder - no central registry to update. This is the pattern most discord.js tutorials of that era pushed, and it held up well even as the command count grew.

Built with Node.js and JavaScript. Uses dotenv for the bot token and a config.js for per-server defaults. The repository is archived now - it was a learning project, not something I wanted to maintain long-term as discord.js evolved (v13 → v14 introduced breaking slash-command changes that would've meant rewriting most of the handlers).

I further developed this project and wrote more bots, including ones supporting music listening and general Discord usage, but that is already in a private repository.

Cerberus BOT screenshot 1