lib/lita/handlers/whoami.rb in lita-whoami-0.1.1 vs lib/lita/handlers/whoami.rb in lita-whoami-0.1.2

- old
+ new

@@ -6,18 +6,20 @@ route(/^(\w+) is (.+)/, :assign_person, command: true, help: { "SOMEONE is SOMETHING" => "Tell everbot that someone is something." }) route(/^who ?is (\w+)/, :describe_person, command: true, help: { - "SOMEONE is SOMETHING" => "Tell everbot that someone is something." + "who is PERSON" => "Everbot will tell you who somebody is." }) def key_for_person name "#{REDIS_KEY}:#{name}" end def assign_person(chat) name, thing = chat.matches[0] + + return if name == 'who' redis.rpush key_for_person(name), thing chat.reply "Okay, #{name} is #{thing}!" end