]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
lastfm: require num parameter for lastfm action to be an integer
authorRaine Virta <rane@kapsi.fi>
Thu, 19 Feb 2009 01:49:08 +0000 (03:49 +0200)
committerRaine Virta <rane@kapsi.fi>
Thu, 19 Feb 2009 01:54:35 +0000 (03:54 +0200)
data/rbot/plugins/lastfm.rb

index 811a63aa1dc5e6057948aa007082dde4b65d0d94..9be57d1617e9e18016f767c0a0df397a88da8df4 100644 (file)
@@ -620,13 +620,15 @@ plugin.map 'lastfm who [:who]', :action => :get_user, :thread => true
 plugin.map 'lastfm compare to :user2', :action => :tasteometer, :thread => true
 plugin.map 'lastfm compare [:user1] [to] :user2', :action => :tasteometer, :thread => true
 plugin.map "lastfm [user] [:num] :action [:user]", :thread => true,
-  :requirements => { :action =>
-    /^(?:events|shouts|friends|neighbou?rs|loved(?:tracks)?|recent(?:t?racks)?|top(?:album|artist|track)s?|weekly(?:albums?|artists?|tracks?)(?:chart)?)$/
+  :requirements => {
+    :action => /^(?:events|shouts|friends|neighbou?rs|loved(?:tracks)?|recent(?:t?racks)?|top(?:album|artist|track)s?|weekly(?:albums?|artists?|tracks?)(?:chart)?)$/,
+    :num => /^\d+$/
 }
 plugin.map 'lastfm [user] [:num] :action [:user] over [*period]', :thread => true,
   :requirements => {
     :action => /^(?:top(?:album|artist|track)s?)$/,
-    :period => /^(?:(?:3|6|12) months)|(?:a\s|1\s)?year$/
+    :period => /^(?:(?:3|6|12) months)|(?:a\s|1\s)?year$/,
+    :num => /^\d+$/
 }
 plugin.map 'lastfm [now] [:who]', :action => :now_playing, :thread => true
 plugin.map 'np [:who]', :action => :now_playing, :thread => true