diff options
-rw-r--r-- | data/rbot/plugins/lastfm.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index 45280d2f..05d9df41 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -210,6 +210,9 @@ class LastFmPlugin < Plugin end end now = artist = track = albumtxt = date = nil + unless doc.root.elements["recenttracks"].has_elements? + m.reply _("%{u} hasn't played anything recently") % {:u => user} + end first = doc.root.elements[1].elements[1] now = first.attributes["nowplaying"] artist = first.elements["artist"].text @@ -231,7 +234,7 @@ class LastFmPlugin < Plugin verb = @registry["#{m.sourcenick}_verb_past"] end ago = Utils.timeago(past) - m.reply _("%{u} is %{v} to \"%{t}\" by %{a} %{b}%{p}") % {:u => user, :v => verb, :t => track, :a => artist, :b => album, :p => ago} + m.reply _("%{u} %{v} to \"%{t}\" by %{a} %{b}%{p}") % {:u => user, :v => verb, :t => track, :a => artist, :b => album, :p => ago} end end |