Added noemo and grass
This commit is contained in:
15
src/modules/grass.rs
Normal file
15
src/modules/grass.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use irc::proto::Message;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
pub const PATTERN: &str = "\\$grass (?P<nick>[^\\s]+)";
|
||||
|
||||
pub fn touch_grass(captures: regex::Captures, message: &Message, _: &VecDeque<Message>) -> Option<(String, String)> {
|
||||
|
||||
let grass_toucher = captures.get(1).unwrap().as_str();
|
||||
|
||||
let complete_message = format!("{} thinks you should go outside and touch some grass, {}",
|
||||
message.source_nickname().unwrap_or("unknown_nick").to_string(),
|
||||
grass_toucher);
|
||||
|
||||
Some((message.response_target().unwrap_or("#lug").to_string(), complete_message.to_string()))
|
||||
}
|
||||
Reference in New Issue
Block a user