diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-14 22:00:08 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-02-14 22:00:08 +0000 |
commit | d29df50ddaf32536b105decefb135a0b86ee937f (patch) | |
tree | eaf5505ba5a8b569aefdb157eff80cf902fe444d /data/rbot/plugins/imdb.rb | |
parent | ad78fb47422664c9ce24a3b62194e42974274af7 (diff) |
Modernize/optimize/cleanup a bunch of plugins
Remove some unnecessary plugin.register() calls, replace other by plugin.map() calls.
Also use e.g. Array#pick_one instead of ar[rand(ar.length)]
Diffstat (limited to 'data/rbot/plugins/imdb.rb')
-rw-r--r-- | data/rbot/plugins/imdb.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index 432d0efc..48c49dc3 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -70,16 +70,12 @@ class ImdbPlugin < Plugin "imdb <string> => search http://www.imdb.org for <string>" end - def privmsg(m) - unless(m.params && m.params.length > 0) - m.reply "incorrect usage: " + help(m.plugin) - return - end - + def imdb(m, params) + what = params[:what].to_s i = Imdb.new(@bot) - info = i.info(m.params) + info = i.info(what) if !info - m.reply "Nothing found for #{m.params}" + m.reply "Nothing found for #{what}" return nil end m.reply "#{info[1]} : #{info[0]}" @@ -88,5 +84,5 @@ class ImdbPlugin < Plugin end plugin = ImdbPlugin.new -plugin.register("imdb") +plugin.map "imdb *what" |