fm01 is a Discord bot built to replace and improve upon its predecessor, FightMan01 bot. It's a versatile bot featuring moderation, utility, and fun commands.
- Docker with the Compose plugin (
docker compose) - Git
- A Discord bot token from the Developer Portal (enable all three privileged intents: Presence, Server Members, and Message Content)
- Optional:
justfor the shortcut recipes injustfile
git clone https://github.com/fm01-bot/fm01.git
cd fm01cp .env.example .envFill in at least:
| Variable | Description |
|---|---|
TOKEN |
Your bot token |
DB_PASSWORD |
Any strong password; used to create the PostgreSQL database |
LAVALINK_PASSWORD |
Any strong password; shared between the bot and Lavalink |
Leave DB_HOST=db, LAVALINK_URI=http://lavalink:2333 and the Redis URLs as they are because they point to the Compose
services. DEBUG_TOKEN is only needed for debug mode, SENTRY_DSN is optional, and the clustering settings should
stay at BOT_MODE=standalone for self-hosting.
cp services/bot/config.yml.example services/bot/config.ymlThen edit it:
owner_ids: replace with your own Discord user ID(s)emojis: set to emoji markdown your bot can use (e.g.<:check:123456789012345678>)log_channel_id: a private channel ID for runtime error reports if aSENTRY_DSNwas not configured in.envmodules: the cogs to load ("*"loads all of them)
docker compose up -d --buildDatabase migrations run automatically before the bot starts: the migrations service applies them, and the bot waits for it to finish successfully.
Check that it's running:
docker compose logs -f bot| Task | Command | just shortcut |
|---|---|---|
| Start | docker compose up -d |
just up |
| Stop | docker compose down |
just down |
| Restart the bot | docker compose restart bot |
just restart bot |
| View logs | docker compose logs -f bot |
just logs bot |
| Delete all data | docker compose down -v |
just destroy |
Warning
docker compose down -v / just destroy permanently deletes the database volume. Only use it in debug environments!
Production runs a gateway proxy that holds the shard connections to
Discord. The bot connects to the proxy instead, so restarting it replays the guild state from the proxy's cache instead
of identifying every shard again (Discord allows one IDENTIFY per 5 seconds). Self-hosters don't need it: leave
DISCORD_GATEWAY_URL unset and the bot connects to Discord directly.
To enable it, set in .env:
COMPOSE_PROFILES=gateway-proxy
DISCORD_GATEWAY_URL=ws://gateway-proxy:7878
SHARD_COUNT=32 # must match the proxy; the bot refuses to start otherwiseThe proxy's shard count comes from Discord's recommendation; curl localhost:7878/shard-count prints it. Its intents
in gateway-proxy.json must match the bot's (discord.Intents.all()), since the bot's own IDENTIFY never reaches
Discord.
just deploychecks out the latest release, rebuilds the bot and the migrations service, runs migrations, then restarts only the bot; the proxy keeps the shards connected.just deploy v0.9.0deploys (or rolls back to) a given release, andjust deploy mainthe testing branch.just deploy-proxyrecreates the proxy, which reconnects every shard. Use it for proxy upgrades and shard count changes only, and updateSHARD_COUNTfirst when the count changes.
Voice sessions don't survive a bot restart: players that were playing stop and have to be started again.
Set debug: true in config.yml and provide DEBUG_TOKEN in .env. The bot will log in with the debug token and
log errors verbosely. just debug starts the stack (or restarts the bot if it's already running) and tails its logs.
Development tooling runs on the host via uv, but the bot itself still runs in Docker.
uv sync # install dev dependencies
uv run ruff format . # format
uv run ruff check . # lint
uv run ty check # type check
uv run pytest # testsSee CONTRIBUTING.md and AGENTS.md for coding standards.
Version numbers follow MAJOR.MINOR.PATCH:
- MAJOR: Breaking changes (e.g., full module overhauls)
- Resets MINOR and PATCH to
0
- Resets MINOR and PATCH to
- MINOR: New features or updated command sets
- Resets PATCH to
0
- Resets PATCH to
- PATCH: Bugfixes, internal tweaks, or localization updates