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§
- commands
- IRC commands
Structs§
- Client
- An IRC client
- Config
- Config for the IRC client
For more information about what arguments the IRC commands take, seecommands::Command
.