summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/excuse.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-14 22:00:08 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-14 22:00:08 +0000
commitd29df50ddaf32536b105decefb135a0b86ee937f (patch)
treeeaf5505ba5a8b569aefdb157eff80cf902fe444d /data/rbot/plugins/excuse.rb
parentad78fb47422664c9ce24a3b62194e42974274af7 (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/excuse.rb')
-rw-r--r--data/rbot/plugins/excuse.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/rbot/plugins/excuse.rb b/data/rbot/plugins/excuse.rb
index 38e85ad6..ad0e8334 100644
--- a/data/rbot/plugins/excuse.rb
+++ b/data/rbot/plugins/excuse.rb
@@ -459,12 +459,12 @@ class ExcusePlugin < Plugin
def help(plugin, topic="")
"excuse => supply a random excuse"
end
- def privmsg(m)
- excuse = @@excuses[rand(@@excuses.length)]
- m.reply excuse
+
+ def excuse(m, params)
+ m.reply @@excuses.pick_one
end
end
plugin = ExcusePlugin.new
-plugin.register("excuse")
+plugin.map "excuse"