end
def bot_rescan(m, param)
- m.reply _("saving ...")
- @bot.save
- m.reply _("rescanning ...")
- @bot.rescan
- m.reply _("done. %{plugin_status}") % {:plugin_status => @bot.plugins.status(true)}
+ if param[:botmodule]
+ name = param[:botmodule]
+ if not @bot.plugins.has_key? name
+ m.reply _("botmodule not found")
+ return # error
+ else
+ botmodule = @bot.plugins[name]
+ m.reply _("botmodule %s... saving... rescanning...") % [name]
+ end
+ else
+ m.reply _("saving... rescanning...")
+ end
+
+ @bot.rescan(botmodule)
+ m.reply _("done. %{plugin_status}") % {
+ :plugin_status => @bot.plugins.status(true)}
+ failure = @bot.plugins.botmodule_failure(name) if botmodule
+ if failure
+ m.reply _("plugin failed to load, %{failure}") % {
+ :failure => failure}
+ end
end
def bot_nick(m, param)
when "save"
_("save => save current dynamic data and configuration")
when "rescan"
- _("rescan => reload modules and static facts")
+ _("rescan [<botmodule>] => reload specified or all botmodules and static facts")
+ when "reload"
+ _("reload [<botmodule>] => reload specified or all botmodules and static facts")
when "version"
_("version => describes software version")
else
- _("config-related tasks: config, save, rescan, version, nick, status")
+ _("config-related tasks: config, save, rescan(/reload), version, nick, status")
end
end
conf.map "save",
:action => 'bot_save'
-conf.map "rescan",
+conf.map "rescan [:botmodule]",
+ :action => 'bot_rescan'
+conf.map "reload [:botmodule]",
:action => 'bot_rescan'
conf.map "nick :nick",
:action => 'bot_nick'