Crate async_circe[−][src]
Expand description
A simple IRC crate written in rust
use circe::{commands::Command, Client, Config};
fn main() -> Result<(), tokio::io::Error> {
let config = Default::default();
let mut client = Client::new(config).await.unwrap();
client.identify().await.unwrap();
loop {
if let Ok(ref command) = client.read().await {
if let Command::OTHER(line) = command {
print!("{}", line);
}
if let Command::PRIVMSG(nick, channel, message) = command {
println!("PRIVMSG received from {}: {} {}", nick, channel, message);
}
}
}
}
Modules
IRC comamnds