]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
lastfm: say something when user top/weekly chart is empty
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 16 Feb 2009 21:05:35 +0000 (22:05 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 16 Feb 2009 21:05:35 +0000 (22:05 +0100)
data/rbot/plugins/lastfm.rb

index 71fde1f4e6356742cc08be7aaecd81f88a46d1d8..29f85aab8623b25f9942e65793eec253eb67993f 100644 (file)
@@ -550,7 +550,11 @@ class LastFmPlugin < Plugin
           :bold   => Bold
         }
       end
-      m.reply items[0, num].join(", ")
+      if items.empty?
+        m.reply _("%{user} hasn't played anything in this period of time") % { :user => user }
+      else
+        m.reply items[0, num].join(", ")
+      end
     end
   end