Crate async_circe[−][src]
Expand description
A simple IRC crate written in rust
use async_circe::{commands::Command, Client, Config};
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), tokio::io::Error> {
let config = Config::default();
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);
}
}
}
}
The crate requires tokio
with the macros
and rt
feature enabled to function.
For more examples (connecting to IRCs that dont use SSL, getting the config from
a toml file, debugging or just in general an overview how a project with async-circe
is structured) see the examples folder on our git.
Modules
IRC commands
Structs
An IRC client
Config for the IRC client
For more information about what arguments the IRC commands take, see commands::Command
.