24 lines
650 B
Rust
24 lines
650 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"],
|
|
"karx.xyz",
|
|
Some("+B"),
|
|
Some("async-circe"),
|
|
6697,
|
|
"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);
|
|
}
|
|
}
|
|
}
|
|
}
|