Updated examples after Command redesign.
This commit is contained in:
parent
2eb0e63d59
commit
b6ce088693
4 changed files with 17 additions and 42 deletions
|
@ -17,12 +17,11 @@ fn main() {
|
|||
for message in server.iter() {
|
||||
let message = message.unwrap(); // We'll just panic if there's an error.
|
||||
print!("{}", message.into_string());
|
||||
if &message.command[..] == "PRIVMSG" {
|
||||
if let Some(msg) = message.suffix {
|
||||
if msg.contains("pickles") {
|
||||
server.send_privmsg(&message.args[0], "Hi!").unwrap();
|
||||
}
|
||||
}
|
||||
match message.command {
|
||||
Command::PRIVMSG(ref target, ref msg) => if msg.contains("pickles") {
|
||||
server.send_privmsg(target, "Hi!").unwrap();
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue