From 0d1ebb2da9e05966d6b3e6084186c65836b56668 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 3 Sep 2014 19:42:16 -0400 Subject: write some login messages on connect in the example --- examples/client.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/examples/client.rs b/examples/client.rs index ce563e0..90a6b32 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,8 +1,31 @@ extern crate irc; +use irc::constants::{CommandMessage, Nick, User}; + fn main () { let mut client = irc::Client::new("doytest", "chat.freenode.net", 6667); client.connect(); + + client.write( + irc::Message::new( + None, + CommandMessage(Nick), + vec!["doytest".to_string()], + ) + ); + client.write( + irc::Message::new( + None, + CommandMessage(User), + vec![ + "doytest".to_string(), + "localhost".to_string(), + "localhost".to_string(), + "doytest".to_string(), + ], + ) + ); + loop { let res = client.read(); println!("{}", res); -- cgit v1.2.3-54-g00ecf