commit
65cdfd1f80
2 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "irc"
|
name = "irc"
|
||||||
version = "0.13.0"
|
version = "0.13.1"
|
||||||
description = "A simple, thread-safe, and async-friendly library for IRC clients."
|
description = "A simple, thread-safe, and async-friendly library for IRC clients."
|
||||||
authors = ["Aaron Weiss <awe@pdgn.co>"]
|
authors = ["Aaron Weiss <awe@pdgn.co>"]
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
|
|
14
README.md
14
README.md
|
@ -34,13 +34,13 @@ use irc::client::prelude::*;
|
||||||
fn main() {
|
fn main() {
|
||||||
let cfg = Config {
|
let cfg = Config {
|
||||||
nickname: Some(format!("irc-rs")),
|
nickname: Some(format!("irc-rs")),
|
||||||
server: Some(format!("irc.example.com")),
|
client: Some(format!("irc.example.com")),
|
||||||
channels: Some(vec![format!("#test")]),
|
channels: Some(vec![format!("#test")]),
|
||||||
.. Default::default()
|
.. Default::default()
|
||||||
};
|
};
|
||||||
let server = IrcServer::from_config(cfg).unwrap();
|
let client = IrcClient::from_config(cfg).unwrap();
|
||||||
server.identify().unwrap();
|
client.identify().unwrap();
|
||||||
server.for_each_incoming(|message| {
|
client.for_each_incoming(|message| {
|
||||||
// Do message processing.
|
// Do message processing.
|
||||||
}).unwrap()
|
}).unwrap()
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ extern crate irc;
|
||||||
use irc::client::prelude::*;
|
use irc::client::prelude::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let server = IrcServer::new("config.toml").unwrap();
|
let client = IrcClient::new("config.toml").unwrap();
|
||||||
server.identify().unwrap();
|
client.identify().unwrap();
|
||||||
server.for_each_incoming(|message| {
|
client.for_each_incoming(|message| {
|
||||||
// Do message processing.
|
// Do message processing.
|
||||||
}).unwrap()
|
}).unwrap()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue