]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
lart plugin: fix listlart/praise logic
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 7 Nov 2007 18:29:36 +0000 (18:29 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 7 Nov 2007 18:29:36 +0000 (18:29 +0000)
data/rbot/plugins/lart.rb

index a70c67b858542491ee89417cf524eed180588b85..657537f0ed6644e7bc847b2bb4504a22326dc024 100644 (file)
@@ -139,7 +139,7 @@ class LartPlugin < Plugin
   def handle_listlart(m, params)
     rx = Regexp.new(params[:lart].to_s, true)
     list = @larts.grep(rx)
-    if list
+    unless list.empty?
       m.reply list.join(" | "), :split_at => /\s+\|\s+/
     else
       m.reply "no lart found matching #{params[:lart]}"
@@ -161,7 +161,7 @@ class LartPlugin < Plugin
   def handle_listpraise(m, params)
     rx = Regexp.new(params[:praise].to_s, true)
     list = @praises.grep(rx)
-    if list
+    unless list.empty?
       m.reply list.join(" | "), :split_at => /\s+\|\s+/
     else
       m.reply "no praise found matching #{params[:praise]}"