Skip to content

Getting Started

Maxime Gauthier edited this page Apr 30, 2026 · 1 revision

Getting Started

OpenModBot runs as a Discord bot process. The default setup uses OpenAI and in-memory moderation state, which is enough for local testing and small trials.

Requirements

  • Ruby 3.3.11
  • Bundler 2.4.5 or newer
  • Discord bot token
  • OpenAI API key, or Google AI API key when using the google_ai plugin

Install

From the bot directory:

gem install bundler -v 2.4.5
bundle install

Copy .env.sample to .env and fill in the required secrets:

DISCORD_BOT_TOKEN=my_discord_secret
OPENAI_API_KEY=my_openai_secret

Run the bot:

bundle exec ruby bot.rb

Docker

Run the bot with Compose:

docker compose up --build

Use the Redis profile for Redis-backed core moderation state:

BUNDLE_WITH=redis PLUGINS=redis docker compose --profile redis up --build

Use the Postgres profile for harassment insights:

BUNDLE_WITH=postgres PLUGINS=postgres,harassment docker compose --profile postgres up --build

Compose starts a local postgres service, initializes the harassment schema from db/harassment/001_initial_schema.sql, and points the bot at postgres://postgres:postgres@postgres:5432/openmodbot unless DATABASE_URL is overridden.

Clone this wiki locally