lib/robut/plugin/lunch.rb in robut-0.2.1 vs lib/robut/plugin/lunch.rb in robut-0.3.0

- old
+ new

@@ -1,11 +1,22 @@ # Where should we go to lunch today? -class Robut::Plugin::Lunch < Robut::Plugin::Base +class Robut::Plugin::Lunch + include Robut::Plugin + # 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} remove lunch place <place> - tells #{nick} not to suggest <place> anymore" + ] + end + # Replies with a random string selected from +places+. def handle(time, sender_nick, message) - words = words(message) + words = words(message) phrase = words.join(' ') # lunch? if phrase =~ /(lunch|food)\?/i if places.empty? reply "I don't know about any lunch places" @@ -51,7 +62,7 @@ # Sets the list of lunch places to +v+ def places=(v) store["lunch_places"] = v end - + end