From ff452ad1bf111025f0661274ac7fb8b2f769a293 Mon Sep 17 00:00:00 2001 From: Raine Virta Date: Thu, 19 Feb 2009 03:49:08 +0200 Subject: [PATCH] lastfm: require num parameter for lastfm action to be an integer --- data/rbot/plugins/lastfm.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index 811a63aa..9be57d16 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -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 -- 2.39.5