Crates.io | async-circe |
lib.rs | async-circe |
version | 0.2.3 |
source | src |
created_at | 2021-12-28 14:31:26.863446 |
updated_at | 2022-01-05 11:00:13.209259 |
description | IRC crate in Rust |
homepage | |
repository | https://git.karx.xyz/circe/async-circe.git |
max_upload_size | |
id | 504209 |
size | 33,640 |
Circe
is a an IRC crate built to be as minimal as possible. It's currently work-in-progress, and more stuff is on its way!
To start using Circe, just add the crate to your Cargo.toml
, and then follow the example below.
use async_circe::{commands::Command, Client, Config};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), tokio::io::Error> {
let config = Config::new(
&["#chaos", "#async-circe"],
"karx.xyz",
Some("+B"),
Some("async-circe"),
6697,
"circe",
);
let mut client = Client::new(config).await.unwrap();
client.identify().await.unwrap();
loop {
if let Some(command) = client.read().await? {
if let Command::PRIVMSG(nick, channel, message) = command {
println!("{} in {}: {}", nick, channel, message);
}
}
}
}
Happy hacking!