From 784ca0872a8d285854fe3ebbf90aefe5296a4439 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 16 Feb 2009 22:05:35 +0100 Subject: [PATCH] lastfm: say something when user top/weekly chart is empty --- data/rbot/plugins/lastfm.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index 71fde1f4..29f85aab 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -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 -- 2.39.2