# call the cleanup method for each active plugin
def cleanup
- @bot.save_mutex.synchronize do
- delegate 'cleanup'
- end
+ delegate 'cleanup'
reset_botmodule_lists
end
when /^(\S+)\s*(.*)$/
key = $1
params = $2
- (core_modules + plugins).each { |p|
- next unless p.name == key
+
+ # We test for the mapped commands first
+ k = key.to_sym
+ [core_commands, plugin_commands].each { |pl|
+ next unless pl.has_key?(k)
+ p = pl[k][:botmodule]
begin
return p.help(key, params)
rescue Exception => err
error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
end
}
- k = key.to_sym
- [core_commands, plugin_commands].each { |pl|
- next unless pl.has_key?(k)
- p = pl[k][:botmodule]
+
+ # If no such commmand was found, we look for a botmodule with that name
+ (core_modules + plugins).each { |p|
+ next unless p.name == key
begin
- return p.help(p.name, topic)
+ return p.help(key, params)
rescue Exception => err
#rescue TimeoutError, StandardError, NameError, SyntaxError => err
error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)