Expand description
A simple IRC crate written in rust
use circe::{commands::Command, Client, Config};
fn main() -> Result<(), std::io::Error> {
let config = Default::default();
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(nick, channel, message) = command {
println!("PRIVMSG received from {}: {} {}", nick, channel, message);
}
}
}
}
Modules§
- commands
- IRC comamnds
Structs§
- Client
- An IRC client
- Config
- Config for the IRC client
- NoNew
Lines - Custom Error for the
read
function