summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-24 23:21:43 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-24 23:21:43 +0000
commitdcbda9f1deb184db5c5f7c93123bcf7414463701 (patch)
tree7f362c39fc944a99815a8de34f40213074b97e86 /lib/rbot/plugins.rb
parent72ac58a7eaad2fb6c855167bf41cb30354af76c0 (diff)
Implement map! properly this time
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r--lib/rbot/plugins.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index 160a2dcd..7b54d1fc 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -128,6 +128,7 @@ module Plugins
@handler.map(*args)
# register this map
name = @handler.last.items[0]
+ self.register name, {:hidden => true}
unless self.respond_to?('privmsg')
def self.privmsg(m)
@handler.handle(m)
@@ -153,10 +154,11 @@ module Plugins
# register the plugin as a handler for messages prefixed +name+
# this can be called multiple times for a plugin to handle multiple
# message prefixes
- def register(name)
+ def register(name,opts={})
+ raise ArgumentError, "Second argument must be a hash!" unless opts.kind_of?(Hash)
return if Plugins.plugins.has_key?(name)
Plugins.plugins[name] = self
- @names << name
+ @names << name unless opts.fetch(:hidden, false)
end
# default usage method provided as a utility for simple plugins. The