circe

Crates.iocirce
lib.rscirce
version0.1.5
sourcesrc
created_at2021-11-04 17:30:33.578948
updated_at2021-12-06 17:48:14.251261
descriptionIRC crate in Rust
homepage
repositoryhttps://git.karx.xyz/circe.git
max_upload_size
id476758
size42,070
Yash Karandikar (karx1)

documentation

README

Circe

crates.io Documentation Unlicense

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!

Getting started

To start using Circe, just add the crate to your Cargo.toml, and then follow the example below.

use circe::{Client, Config, Command};

fn main() -> Result<(), std::io::Error> {
    let config = Config::from_toml("config.toml")?;
    let mut client = Client::new(config)?;
    client.identify()?;

    loop {
        if let Ok(ref command) = client.read() {
            if let Command::OTHER(line) = command {
                print!("{}", line);
            }
            if let Command::PRIVMSG(channel, message) = command {
                println!("PRIVMSG received: {} {}", channel, message);
            }
        }    
    }
}

Happy hacking!

Commit count: 0

cargo fmt