Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,19 @@ documentation, and below.

The release of v0.14 replaced all existing APIs with one based on async/await.

```rust,no_run,edition2018
use irc::client::prelude::*;
```rust,no_run,edition2021
use futures::prelude::*;
use irc::client::prelude::*;

#[tokio::main]
async fn main() -> Result<(), failure::Error> {
async fn main() -> Result<(), anyhow::Error> {
// We can also load the Config at runtime via Config::load("path/to/config.toml")
let config = Config {
nickname: Some("the-irc-crate".to_owned()),
server: Some("chat.freenode.net".to_owned()),
channels: vec!["#test".to_owned()],
..Config::default()
};

let mut client = Client::from_config(config).await?;
client.identify()?;

Expand All @@ -80,19 +79,25 @@ async fn main() -> Result<(), failure::Error> {
```

Example Cargo.toml file:
```rust,no_run,edition2018
```rust,no_run,edition2021
[package]
name = "example"
version = "0.1.0"
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0"
futures = "0.3"
irc = "1.0.0"
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros", "net", "time"] }
futures = "0.3.0"
failure = "0.1.8"
tokio = { version = "1.0", features = [
"rt",
"rt-multi-thread",
"macros",
"net",
"time",
] }
```

## Configuring IRC Clients
Expand Down
Loading