{"id":13503187,"url":"https://github.com/aatxe/irc","last_synced_at":"2025-05-13T21:11:31.317Z","repository":{"id":20609638,"uuid":"23890761","full_name":"aatxe/irc","owner":"aatxe","description":"the irc crate – usable, async IRC for Rust","archived":false,"fork":false,"pushed_at":"2025-03-24T16:30:57.000Z","size":15049,"stargazers_count":555,"open_issues_count":27,"forks_count":104,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2025-05-08T00:06:07.061Z","etag":null,"topics":["async","client","irc","ircv3","protocol","thread-safe"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aatxe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2014-09-10T20:22:14.000Z","updated_at":"2025-04-19T06:54:03.000Z","dependencies_parsed_at":"2024-06-18T21:20:54.149Z","dependency_job_id":"12e8baa5-ddd4-4b76-856a-dc949759661e","html_url":"https://github.com/aatxe/irc","commit_stats":{"total_commits":775,"total_committers":55,"mean_commits":"14.090909090909092","dds":0.4490322580645161,"last_synced_commit":"d40e3ce8449be0e1538a70dedf153ca3efb1e4ce"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatxe%2Firc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatxe%2Firc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatxe%2Firc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatxe%2Firc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aatxe","download_url":"https://codeload.github.com/aatxe/irc/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254029004,"owners_count":22002283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["async","client","irc","ircv3","protocol","thread-safe"],"created_at":"2024-07-31T22:02:40.727Z","updated_at":"2025-05-13T21:11:26.299Z","avatar_url":"https://github.com/aatxe.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# the irc crate [![Build Status][ci-badge]][ci] [![Crates.io][cr-badge]][cr] ![Downloads][dl-badge] [![Docs][doc-badge]][doc]\n\n[ci-badge]: https://github.com/aatxe/irc/actions/workflows/ci.yml/badge.svg\n[ci]: https://github.com/aatxe/irc/actions/workflows/ci.yml\n[cr-badge]: https://img.shields.io/crates/v/irc.svg\n[cr]: https://crates.io/crates/irc\n[dl-badge]: https://img.shields.io/crates/d/irc.svg\n[doc-badge]: https://docs.rs/irc/badge.svg\n[doc]: https://docs.rs/irc\n\n[rfc2812]: http://datatracker.ietf.org/doc/html/rfc2812\n[ircv3.1]: http://ircv3.net/irc/3.1.html\n[ircv3.2]: http://ircv3.net/irc/3.2.html\n\n\"the irc crate\" is a thread-safe and async-friendly IRC client library written in Rust. It's\ncompliant with [RFC 2812][rfc2812], [IRCv3.1][ircv3.1], [IRCv3.2][ircv3.2], and includes some\nadditional, common features from popular IRCds. You can find up-to-date, ready-to-use documentation\nonline [on docs.rs][doc].\n\n## Built with the irc crate\n\nthe irc crate is being used to build new IRC software in Rust. Here are some of our favorite\nprojects:\n\n- [alectro][alectro] — a terminal IRC client\n- [spilo][spilo] — a minimalistic IRC bouncer\n- [irc-bot.rs][ircbot] — a library for writing IRC bots\n- [playbot_ng][playbot_ng] — a Rust-evaluating IRC bot in Rust\n- [bunnybutt-rs][bunnybutt] — an IRC bot for the [Feed The Beast Wiki][ftb-wiki]\n- [url-bot-rs][url-bot-rs] — a URL-fetching IRC bot\n\n[alectro]: https://github.com/aatxe/alectro\n[spilo]: https://github.com/aatxe/spilo\n[ircbot]: https://github.com/8573/irc-bot.rs\n[bunnybutt]: https://github.com/FTB-Gamepedia/bunnybutt-rs\n[playbot_ng]: https://github.com/panicbit/playbot_ng\n[ftb-wiki]: https://ftb.gamepedia.com/FTB_Wiki\n[url-bot-rs]: https://github.com/nuxeh/url-bot-rs\n\nMaking your own project? [Submit a pull request](https://github.com/aatxe/irc/pulls) to add it!\n\n## Getting Started\n\nTo start using the irc crate with cargo, you can add `irc = \"1.0.0\"` to your dependencies in or you can use the comman `cargo add irc`.\nyour Cargo.toml file. The high-level API can be found in [`irc::client::prelude`][irc-prelude].\nYou'll find a number of examples to help you get started in `examples/`, throughout the\ndocumentation, and below.\n\n[irc-prelude]: https://docs.rs/irc/*/irc/client/prelude/index.html\n\n## Using Futures\n\nThe release of v0.14 replaced all existing APIs with one based on async/await.\n\n```rust,no_run,edition2021\nuse futures::prelude::*;\nuse irc::client::prelude::*;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), anyhow::Error\u003e {\n    // We can also load the Config at runtime via Config::load(\"path/to/config.toml\")\n    let config = Config {\n        nickname: Some(\"the-irc-crate\".to_owned()),\n        server: Some(\"chat.freenode.net\".to_owned()),\n        channels: vec![\"#test\".to_owned()],\n        ..Config::default()\n    };\n    let mut client = Client::from_config(config).await?;\n    client.identify()?;\n\n    let mut stream = client.stream()?;\n\n    while let Some(message) = stream.next().await.transpose()? {\n        print!(\"{}\", message);\n    }\n\n    Ok(())\n}\n```\n\nExample Cargo.toml file:\n```rust,no_run,edition2021\n[package]\nname = \"example\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[dependencies]\nanyhow = \"1.0\"\nfutures = \"0.3\"\nirc = \"1.0.0\"\ntokio = { version = \"1.0\", features = [\n    \"rt\",\n    \"rt-multi-thread\",\n    \"macros\",\n    \"net\",\n    \"time\",\n] }\n```\n\n## Configuring IRC Clients\n\nAs seen above, there are two techniques for configuring the irc crate: runtime loading and\nprogrammatic configuration. Runtime loading is done via the function `Config::load`, and is likely\nsufficient for most IRC bots. Programmatic configuration is convenient for writing tests, but can\nalso be useful when defining your own custom configuration format that can be converted to `Config`.\nThe primary configuration format is TOML, but if you are so inclined, you can use JSON and/or YAML\nvia the optional `json_config` and `yaml_config` features respectively. At the minimum, a configuration\nrequires `nickname` and `server` to be defined, and all other fields are optional. You can find\ndetailed explanations of the various fields on [docs.rs][config-fields].\n\n[config-fields]: https://docs.rs/irc/*/irc/client/data/config/struct.Config.html#fields\n\nAlternatively, you can look at the example below of a TOML configuration with all the fields:\n\n```toml\nowners = []\nnickname = \"user\"\nnick_password = \"password\"\nalt_nicks = [\"user_\", \"user__\"]\nusername = \"user\"\nrealname = \"Test User\"\nserver = \"chat.freenode.net\"\nport = 6697\npassword = \"\"\nproxy_type = \"None\"\nproxy_server = \"127.0.0.1\"\nproxy_port = 1080\nproxy_username = \"\"\nproxy_password = \"\"\nuse_tls = true\ncert_path = \"cert.der\"\nclient_cert_path = \"client.der\"\nclient_cert_pass = \"password\"\nencoding = \"UTF-8\"\nchannels = [\"#rust\", \"#haskell\", \"#fake\"]\numodes = \"+RB-x\"\nuser_info = \"I'm a test user for the irc crate.\"\nversion = \"irc:git:Rust\"\nsource = \"https://github.com/aatxe/irc\"\nping_time = 180\nping_timeout = 20\nburst_window_length = 8\nmax_messages_in_burst = 15\nshould_ghost = false\nghost_sequence = []\n\n[channel_keys]\n\"#fake\" = \"password\"\n\n[options]\nnote = \"anything you want can be in here!\"\nand = \"you can use it to build your own additional configuration options.\"\nkey = \"value\"\n```\n\nYou can convert between different configuration formats with `convertconf` like so:\n\n```shell\ncargo run --example convertconf -- -i client_config.json -o client_config.toml\n```\n\nNote that the formats are automatically determined based on the selected file extensions. This\ntool should make it easier for users to migrate their old configurations to TOML.\n\n## Contributing\nthe irc crate is a free, open source library that relies on contributions from its maintainers,\nAriel Weiss ([@aatxe][awe]) and Peter Atashian ([@retep998][bun]), as well as the broader Rust\ncommunity. It's licensed under the Mozilla Public License 2.0 whose text can be found in\n`LICENSE.md`. To foster an inclusive community around the irc crate, we have adopted a Code of\nConduct whose text can be found in `CODE_OF_CONDUCT.md`. You can find details about how to\ncontribute in `CONTRIBUTING.md`.\n\n[awe]: https://github.com/aatxe/\n[bun]: https://github.com/retep998/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatxe%2Firc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faatxe%2Firc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatxe%2Firc/lists"}