@handler.handle(m)
end
+ def call_event(ev, *args)
+ @bot.plugins.delegate('event_' + ev.to_s.gsub(/[^\w\?!]+/, '_'), *args)
+ end
+
def map(*args)
@handler.map(self, *args)
# register this map
# +message+ as a parameter
def delegate(method, *args)
# debug "Delegating #{method.inspect}"
+ ret = Array.new
[core_modules, plugins].each { |pl|
pl.each {|p|
if(p.respond_to? method)
begin
# debug "#{p.botmodule_class} #{p.name} responds"
- p.send method, *args
+ ret.push p.send(method, *args)
rescue Exception => err
raise if err.kind_of?(SystemExit)
error report_error("#{p.botmodule_class} #{p.name} #{method}() failed:", err)
end
}
}
+ return ret
# debug "Finished delegating #{method.inspect}"
end