lib/robut/plugin/lunch.rb in robut-0.5.1 vs lib/robut/plugin/lunch.rb in robut-0.5.2
- old
+ new
@@ -5,11 +5,11 @@
# Returns a description of how to use this plugin
def usage
[
"lunch? / food? - #{nick} will suggest a place to go eat",
"#{at_nick} lunch places - lists all the lunch places #{nick} knows about",
- "#{at_nick} new lunch place <place> - tells #{nick} about a new place to eat",
+ "#{at_nick} (add|new) lunch place <place> - tells #{nick} about a new place to eat",
"#{at_nick} remove lunch place <place> - tells #{nick} not to suggest <place> anymore"
]
end
# Replies with a random string selected from +places+.
@@ -29,14 +29,14 @@
reply "I don't know about any lunch places"
else
reply places.join(', ')
end
# @robut new lunch place Green Leaf
- elsif phrase =~ /new lunch place (.*)/i && sent_to_me?(message)
+ elsif phrase =~ /(?:new|add) lunch place (.*)/i && sent_to_me?(message)
place = $1
new_place(place)
reply "Ok, I'll add \"#{place}\" to the the list of lunch places"
- # @robut remove luynch place Green Leaf
+ # @robut remove lunch place Green Leaf
elsif phrase =~ /remove lunch place (.*)/i && sent_to_me?(message)
place = $1
remove_place(place)
reply "I removed \"#{place}\" from the list of lunch places"
end