\r
class ConfigModule < CoreBotModule\r
\r
+ def version_string\r
+ _("I'm a v. %{version} rubybot%{copyright}%{url}") % {\r
+ :version => $version,\r
+ :copyright => ", #{Irc::Bot::COPYRIGHT_NOTICE}",\r
+ :url => " - #{Irc::Bot::SOURCE_URL}"\r
+ }\r
+ end\r
+\r
def save\r
@bot.config.save\r
end\r
m.reply _("no such config key %{key}") % {:key => key}\r
return\r
end\r
- unless @bot.config.items[key].kind_of?(BotConfigArrayValue)\r
+ unless @bot.config.items[key].kind_of?(Config::ArrayValue)\r
m.reply _("config key %{key} is not an array") % {:key => key}\r
return\r
end\r
m.reply _("no such config key %{key}") % {:key => key}\r
return\r
end\r
- unless @bot.config.items[key].kind_of?(BotConfigArrayValue)\r
+ unless @bot.config.items[key].kind_of?(Config::ArrayValue)\r
m.reply _("config key %{key} is not an array") % {:key => key}\r
return\r
end\r
# end\r
\r
def bot_version(m, param)\r
- m.reply _("I'm a v. %{version} rubybot, (c) Tom Gilbert and the rbot development team - http://linuxbrit.co.uk/rbot/") % {:version => $version}\r
+ m.reply version_string\r
+ end\r
+\r
+ def ctcp_listen(m)\r
+ who = m.private? ? "me" : m.target\r
+ case m.ctcp.intern\r
+ when :VERSION\r
+ m.ctcp_reply version_string\r
+ @bot.irclog "@ #{m.source} asked #{who} about version info"\r
+ when :SOURCE\r
+ m.ctcp_reply Irc::Bot::SOURCE_URL\r
+ @bot.irclog "@ #{m.source} asked #{who} about source info"\r
+ end\r
end\r
\r
def handle_help(m, params)\r
case plugin\r
when "config"\r
case topic\r
- when ""\r
- _("config-related tasks: config topics, save, rescan")\r
when "list"\r
_("config list => list configuration modules, config list <module> => list configuration keys for module <module>")\r
when "get"\r
# else\r
# "no help for config #{topic}"\r
end\r
+ when "nick"\r
+ _("nick <newnick> => change the bot nick to <newnick>, if possible")\r
+ when "status"\r
+ _("status => display some information on the bot's status")\r
when "save"\r
_("save => save current dynamic data and configuration")\r
when "rescan"\r
_("rescan => reload modules and static facts")\r
+ when "version"\r
+ _("version => describes software version")\r
else\r
- _("config-related tasks: config, save, rescan")\r
+ _("config-related tasks: config, save, rescan, version, nick, status")\r
end\r
end\r
\r
:auth_path => 'show'\r
# TODO this one is presently a security risk, since the bot\r
# stores the master password in the config. Do we need auth levels\r
-# on the BotConfig keys too?\r
+# on the Bot::Config keys too?\r
conf.map 'config get :key',\r
:action => 'handle_get',\r
:auth_path => 'show'\r
conf.default_auth('*', false)\r
conf.default_auth('show::status', true)\r
# TODO these shouldn't be set here, we need a way to let the default\r
-# permission be specified together with the BotConfigValue\r
+# permission be specified together with the ConfigValue\r
conf.default_auth('key', true)\r
conf.default_auth('key::auth::password', false)\r
\r