Very basic test for IRC library, include hyper for HTTP

This commit is contained in:
Darren VanBuren 2016-07-25 17:56:11 -07:00
parent f269514e8a
commit 5bbb554186
3 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,20 @@
extern crate irc;
use irc::client::prelude::*;
fn main() {
println!("Hello, world!");
let server = IrcServer::new("config.json").unwrap();
server.identify().unwrap();
for message in server.iter() {
let message = message.unwrap();
println!("Received message: {}", message);
match message.command {
Command::PRIVMSG(ref target, ref msg) => if msg.contains("rust-bot") {
server.send_privmsg(target, "Hello!").unwrap();
},
_ => (),
}
}
}