17 lines
528 B
Rust
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);
|
|
}
|
|
}
|
|
}
|
|
}
|