- Crystal 99.4%
- Just 0.5%
- Dockerfile 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| scripts | ||
| spec | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| avatar.jpg | ||
| CHANGELOG.md | ||
| Containerfile | ||
| justfile | ||
| lefthook.yml | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
| shard.lock | ||
| shard.yml | ||
Botium
As the duly-elected mobsters of this union, it's our duty to support the struggle of these proud, lazy slobs.
—Donbot
IRCv3 bot written in Crystal 🔮
Connects over TCP (plain/TLS) or WebSocket, negotiates IRCv3 caps, authenticates via SASL PLAIN, joins the configured channels, answers PINGs with PONG-liveness tracking, and reconnects forever with capped exponential backoff.
Usage
!help in a joined channel (or just help in private) to list the available commands.
Features
Core IRCv3
- Multi-transport connectivity: plain TCP, TLS (
ircs://), and WebSocket (ws:///wss://) - IRCv3 capability negotiation, SASL PLAIN authentication, and
draft/metadata-2avatar advertisement - PING/PONG liveness tracking with periodic latency statistics
- Automatic rejoin of channels after reconnection and reconnect-forever with capped exponential backoff
- Multiline message handling
Greeting
- Greets newcomers in a configurable channel (with WHOIS re-verification and a configurable delay)
- Greeting template with
{nick}placeholder; greeted nicks are persisted so repeat visitors aren't re-greeted
Scheduled posts
- Daily random XKCD comic post at a configurable local time
- Daily random MonkeyUser comic post, index generated at image build time from the site's own catalog
- Daily random Dilbert strip post, index generated at image build time from ecstrema/dilbert
- Daily random Work Chronicles comic post, index generated at image build time from the Substack archive API
- Daily random Twonks comic post, index generated at image build time from the site's Bluesky feed
- Daily random programming quote post
Announcements
- RSS/Atom feed polling with per-feed channel routing, dedup checkpoints (ETag/Last-Modified aware), and configurable announcement template
- Forgejo repository-activity announcements (releases, pushes, issues, ...) supporting multiple Forgejo instances, per-repo channel routing, and per-repo ignore lists
Interactive commands
- Central
!commandregistry with help output (!help), plus!xkcd,!quote,!monkeyuser,!dilbert,!twonksand!workchronicleson demand - Channels only accept
!-prefixed commands; private messages accept bare verbs too
HTTP webhook
- Bearer-token-authenticated
POST /v1/sendendpoint for pushing messages to joined channels - Public
GET /v1/healthfor uptime monitoring and telemetry
Operations
- Configuration via environment variables or a
.envfile - Persistent JSON state files (greeted nicks, shown comics/quotes, feed checkpoints)
- Structured logging with configurable level; health-check endpoint
- E2E test suite against a real Ergo server in a podman container
Install
Either via Crystal (Shards) build:
shards build --release botium # compiles the binary under `./bin/botium`
or run the container directly, e.g.:
podman run --rm --env-file .env forge.l3x.in/alex/botium:latest
Development
Commits follow the Conventional Commits specification (feat:, fix:, chore:, ...), which drives both the changelog and versioning: feat bumps the minor version, fix (and everything else) the patch, and breaking changes (feat!: or a BREAKING CHANGE: footer) the major one.
Releasing is automated — bump, changelog, tag, container build and deploy all stem from it:
just release
This derives the next version from the commits since the last tag, updates shard.yml and CHANGELOG.md, commits, tags and pushes. The v* tag then triggers the release workflow, which validates, publishes the container image (v<version> + latest), creates the Forgejo release with the changelog section as notes, and redeploys the service.
Requires:
Run just to list all available commands:
just # available commands
End-to-end validation
spec/e2e_spec.cr runs the IRC client against a real Ergo
server in a podman testcontainer (anonymous registration + cap negotiation,
SASL PLAIN, channel PRIVMSG round trip, WebSocket transport):
E2E=1 crystal spec spec/e2e_spec.cr # requires podman + the ergo image
# or simply:
just e2e
Configuration is via environment variables or a .env file (see
.env.example).
Running dev
cp .env.example .env # edit
just run