]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/lastfm.rb
nickrecover plugin: work more than once per session
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / lastfm.rb
index 08a56f8c07df9d7bafad2e43635279f5499861fa..0c40701c6d98cfe34eb9d38c6967cf3263476533 100644 (file)
@@ -110,7 +110,7 @@ class LastFmPlugin < Plugin
 
     doc = Document.new xml.body
     if xml.class == Net::HTTPInternalServerError
-      if doc.root.attributes["status"] == "failed"
+      if doc.root and doc.root.attributes["status"] == "failed"
         m.reply doc.root.elements["error"].text
       else
         m.reply _("Could not retrieve events")
@@ -427,8 +427,8 @@ plugin.map 'lastfm who :who', :action => :get_user, :thread => true
 plugin.map 'lastfm who', :action => :get_user, :thread => true
 plugin.map 'lastfm compare :user1 :user2', :action => :tasteometer, :thread => true
 plugin.map 'np', :action => :now_playing, :thread => true
-plugin.map 'lastfm', :action => :now_playing, :thread => true
 plugin.map "lastfm [user] :action [:user]", :thread => true,
   :requirements => { :action =>
     /^(?:events|friends|neighbou?rs|playlists|recent?tracks|top(?:album|artist|tag)s?|weekly(?:album|artist|track)chart|weeklychartlist)$/
 }
+plugin.map "lastfm [:who]", :action => :now_playing, :thread => true