From 4d8d87fc2ce86977f61c2528870788783b42e4f3 Mon Sep 17 00:00:00 2001 From: famfo Date: Tue, 28 Dec 2021 15:34:38 +0100 Subject: [PATCH] Update readme --- README.md | 23 ++++++++++------------- examples/basic-config/Cargo.lock | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 10650d7..bc4985a 100644 --- a/README.md +++ b/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! \ No newline at end of file +Happy hacking! diff --git a/examples/basic-config/Cargo.lock b/examples/basic-config/Cargo.lock index 75ce2ab..589ef1b 100644 --- a/examples/basic-config/Cargo.lock +++ b/examples/basic-config/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "async-circe" -version = "0.1.5" +version = "0.1.0" dependencies = [ "async-native-tls", "tokio",