IRC library in Rust.
Go to file
Yash Karandikar 8dca0b4a7f Trim source buffer to how many bytes were read 2021-12-06 12:25:40 -06:00
examples Updated .gitignore 2021-11-13 11:47:42 -06:00
src Trim source buffer to how many bytes were read 2021-12-06 12:25:40 -06:00
tests Added crate feature, fixed docs, added examples and tests 2021-11-13 11:47:37 -06:00
.gitignore Inlined 'Cargo.lock' in '.gitignore' 2021-12-06 11:05:35 -06:00
Cargo.lock Trim source buffer to how many bytes were read 2021-12-06 12:25:40 -06:00
Cargo.toml Bump version number 2021-12-06 11:46:36 -06:00
LICENSE Prepare crate for publishing 2021-11-04 12:29:01 -05:00
README.md Update docs to show new examples 2021-11-04 13:58:01 -05:00
config.toml Trim empty bytes from the pre-allocated buffer 2021-11-16 15:19:19 -06:00

README.md

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!