async-circe/examples/non-tls-irc/src/main.rs
2022-01-05 11:53:20 +01:00

24 lines
663 B
Rust

use async_circe::{commands::Command, Client, Config};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), tokio::io::Error> {
let config = Config::new(
&["#main", "#no-normies"],
"192.168.178.100",
Some("+B"),
Some("async-circe"),
6667,
"async-circe",
);
let mut client = Client::new(config).await.unwrap();
client.identify().await.unwrap();
loop {
if let Some(command) = client.read().await? {
if let Command::PRIVMSG(nick, channel, message) = command {
println!("{} in {}: {}", nick, channel, message);
}
}
}
}