Update readme
This commit is contained in:
parent
df466a44b3
commit
4d8d87fc2c
23
README.md
23
README.md
|
@ -1,7 +1,7 @@
|
|||
# Circe
|
||||
|
||||
[![crates.io](https://img.shields.io/crates/v/circe.svg)](https://crates.io/crates/circe)
|
||||
[![Documentation](https://docs.rs/circe/badge.svg)](https://docs.rs/circe)
|
||||
[![crates.io](https://img.shields.io/crates/v/circe.svg)](https://crates.io/crates/async-circe)
|
||||
[![Documentation](https://docs.rs/circe/badge.svg)](https://docs.rs/async-circe)
|
||||
[![Unlicense](https://img.shields.io/crates/l/circe.svg)](./LICENSE)
|
||||
|
||||
`Circe` is a an IRC crate built to be as minimal as possible. It's currently work-in-progress, and more stuff is on its way!
|
||||
|
@ -14,21 +14,18 @@ To start using Circe, just add the crate to your `Cargo.toml`, and then follow t
|
|||
use circe::{Client, Config, Command};
|
||||
|
||||
fn main() -> Result<(), std::io::Error> {
|
||||
let config = Config::from_toml("config.toml")?;
|
||||
let mut client = Client::new(config)?;
|
||||
client.identify()?;
|
||||
let config = Default::default();
|
||||
let mut client = Client::new(config).await.unwrap();
|
||||
client.identify().await.unwrap();
|
||||
|
||||
loop {
|
||||
if let Ok(ref command) = client.read() {
|
||||
if let Command::OTHER(line) = command {
|
||||
print!("{}", line);
|
||||
if let Ok(ref command) = client.read().await {
|
||||
if let Command::PRIVMSG(nick, channel, message) = command {
|
||||
println!("{} in {}: {}", nick, channel, message);
|
||||
}
|
||||
if let Command::PRIVMSG(channel, message) = command {
|
||||
println!("PRIVMSG received: {} {}", channel, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Happy hacking!
|
||||
Happy hacking!
|
||||
|
|
2
examples/basic-config/Cargo.lock
generated
2
examples/basic-config/Cargo.lock
generated
|
@ -4,7 +4,7 @@ version = 3
|
|||
|
||||
[[package]]
|
||||
name = "async-circe"
|
||||
version = "0.1.5"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-native-tls",
|
||||
"tokio",
|
||||
|
|
Loading…
Reference in a new issue