IRC library in Rust.
Go to file
2021-11-08 11:01:20 -06:00
src Numerous new commands, documentation changews, started with ssl 2021-11-08 11:01:20 -06:00
.gitignore Add support for reading from the socket 2021-10-31 11:11:53 -05:00
Cargo.lock Numerous new commands, documentation changews, started with ssl 2021-11-08 11:01:20 -06:00
Cargo.toml Numerous new commands, documentation changews, started with ssl 2021-11-08 11:01:20 -06:00
config.toml Added QUIT and PART 2021-11-07 20:12:00 -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

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!