ircbot
An async IRC bot framework for Rust powered by Tokio and procedural macros.
use ;
async
Highlights
- Proc-macro API — annotate methods with
#[command]or#[on];#[bot]wires everything up. - Flexible triggers — commands (
!ping), glob patterns ("you are *"), raw IRC events, mention detection, cron schedules — all with optional target-channel and regex filters. - Reply helpers —
ctx.reply(),ctx.say(),ctx.action(),ctx.notice(),ctx.whisper(). - Keepalive & auto-reconnect — periodic
PING/PONGmonitoring; reconnects and re-joins on drop. - Hot reload (Unix) —
SIGHUPexecs the new binary with the live TCP socket inherited; no reconnect, no missed messages. - Flood protection — token-bucket rate limiter (default: burst 4, 1 msg / 500 ms).
- Auto message splitting — long messages are word-wrapped and split within the 512-byte IRC limit.
- Output sanitization —
\r,\n,\0stripped from every outgoing message. - Unit-testable —
ircbot::testing::TestContextlets you test handlers without a live server.
Full API reference: docs.rs/ircbot
Getting started
[]
= "0.1"
= { = "1", = ["full"] }
See the basic_bot example and the docs for the complete API, hot-reload guide, testing helpers, and lower-level State / internal APIs.
License
MIT
AI Disclaimer
This project was written primarily by AI, orchestrated, supervised and reviewed by a human (me). Feel free to use any AI tool for contributions to this project.