{"id":50587836,"url":"https://github.com/chrj/ircbot","last_synced_at":"2026-06-05T07:30:53.309Z","repository":{"id":361600318,"uuid":"1187534177","full_name":"chrj/ircbot","owner":"chrj","description":"Rust IRC bot framework ","archived":false,"fork":false,"pushed_at":"2026-05-31T11:34:57.000Z","size":356,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T13:14:27.670Z","etag":null,"topics":["irc","irc-bot","macros-rust","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-20T20:52:24.000Z","updated_at":"2026-05-31T11:34:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chrj/ircbot","commit_stats":null,"previous_names":["chrj/ircbot"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/chrj/ircbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrj%2Fircbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrj%2Fircbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrj%2Fircbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrj%2Fircbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrj","download_url":"https://codeload.github.com/chrj/ircbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrj%2Fircbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33934370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["irc","irc-bot","macros-rust","rust","rust-library"],"created_at":"2026-06-05T07:30:52.690Z","updated_at":"2026-06-05T07:30:53.304Z","avatar_url":"https://github.com/chrj.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ircbot\n\n[![ircbot on crates.io](https://img.shields.io/crates/v/ircbot.svg)](https://crates.io/crates/ircbot)\n[![ircbot-macros on crates.io](https://img.shields.io/crates/v/ircbot-macros.svg)](https://crates.io/crates/ircbot-macros)\n[![docs.rs](https://docs.rs/ircbot/badge.svg)](https://docs.rs/ircbot)\n\nAn async IRC bot framework for Rust powered by [Tokio](https://tokio.rs/) and procedural macros.\n\n```rust,ignore\nuse ircbot::{bot, Context, User, Result};\n\n#[bot]\nimpl MyBot {\n    #[command(\"ping\")]\n    async fn ping(\u0026self, ctx: Context) -\u003e Result {\n        ctx.reply(\"Pong!\")\n    }\n\n    #[on(message = \"you are *\")]\n    async fn praise_me(\u0026self, ctx: Context) -\u003e Result {\n        ctx.say(\"Correct.\")\n    }\n\n    #[on(event = \"JOIN\")]\n    async fn welcome(\u0026self, ctx: Context, user: User) -\u003e Result {\n        ctx.say(format!(\"Welcome, {}!\", user.nick))\n    }\n\n    #[on(cron = \"0 0 9 * * MON-FRI\", target = \"#general\")]\n    async fn morning(\u0026self, ctx: Context) -\u003e Result {\n        ctx.say(\"Good morning!\")\n    }\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error + Send + Sync\u003e\u003e {\n    MyBot::new(\"mybot\", \"localhost:6667\", [\"general\"])\n        .await?\n        .main_loop()\n        .await\n}\n```\n\n## Highlights\n\n- **Proc-macro API** — annotate methods with `#[command]` or `#[on]`; `#[bot]` wires everything up.\n- **Typed state** — `#[bot(state = MyState)]` adds a `pub state` field your handlers can read; mutate it through interior mutability (`Mutex`/atomics). See `examples/stateful_bot.rs`.\n- **Flexible triggers** — commands (`!ping`), glob patterns (`\"you are *\"`), raw IRC events, mention detection, cron schedules — all with optional target-channel and regex filters.\n- **Reply helpers** — `ctx.reply()`, `ctx.say()`, `ctx.action()`, `ctx.notice()`, `ctx.whisper()`.\n- **Channel control** — `ctx.join()` and `ctx.part()` to make the bot enter or leave channels from a handler.\n- **Raw escape hatch** — `ctx.raw()` sends any IRC line the helpers don't wrap (`MODE`, `INVITE`, …), still sanitized.\n- **Moderation** — `ctx.set_topic()` and `ctx.kick()` act on the channel the message arrived in.\n- **Message accessors** — `ctx.nick()`, `ctx.is_from_self()`, `ctx.mentions_me()` to inspect who sent a message and what it says.\n- **Keepalive \u0026 auto-reconnect** — periodic `PING`/`PONG` monitoring; reconnects and re-joins on drop. If the configured nick is already in use, the bot automatically retries with a suffixed alternative (`bot`, `bot_`, …).\n- **Hot reload** (Unix) — `SIGHUP` execs the new binary with the live TCP socket inherited; no reconnect, no missed messages.\n- **Flood protection** — token-bucket rate limiter (default: burst 4, 1 msg / 500 ms).\n- **Auto message splitting** — long messages are word-wrapped and split within the 512-byte IRC limit.\n- **Output sanitization** — `\\r`, `\\n`, `\\0` stripped from every outgoing message.\n- **Unit-testable** — `ircbot::testing::TestContext` lets you test handlers without a live server.\n- **Structured logging** — diagnostics are emitted through [`tracing`](https://docs.rs/tracing); you pick the subscriber, level, and format. Raw IRC traffic is available opt-in on the `ircbot::protocol` target.\n\nFull API reference: **[docs.rs/ircbot](https://docs.rs/ircbot)**\n\n## Getting started\n\n```toml\n[dependencies]\nircbot = \"0.2\"\ntokio  = { version = \"1\", features = [\"full\"] }\n```\n\nSee the [`basic_bot` example](ircbot/examples/basic_bot.rs) and the [docs](https://docs.rs/ircbot) for the complete API, hot-reload guide, testing helpers, and lower-level `State` / `internal` APIs.\n\n## Logging\n\nThe framework emits structured [`tracing`](https://docs.rs/tracing) events and\ninstalls no subscriber of its own, so verbosity, format, and destination are\nyours to configure. Raw IRC traffic is available opt-in on the `ircbot::protocol`\ntarget.\n\nSee the [`logging` module docs](https://docs.rs/ircbot/latest/ircbot/logging/)\nfor subscriber setup and the raw-protocol opt-in.\n\n## License\n\nMIT\n\n## AI Disclaimer\n\nThis project was written primarily by AI, orchestrated, supervised and reviewed by a human (me).\nFeel free to use any AI tool for contributions to this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrj%2Fircbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrj%2Fircbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrj%2Fircbot/lists"}