async-circe/examples/config-from-toml/src/main.rs
2022-01-05 11:53:57 +01:00

17 lines
528 B
Rust

use async_circe::{commands::Command, Client, Config};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), std::io::Error> {
let config = Config::from_toml("Config.toml")?;
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);
}
}
}
}