@@ -220,8+220,8 @@ class AuthModule < CoreBotModule
auth = nil
if cmds.has_key?(k)
cmds[k][:botmodule].handler.each do |tmpl|
auth = nil
if cmds.has_key?(k)
cmds[k][:botmodule].handler.each do |tmpl|
- options, failure = tmpl.recognize(pseudo)
- next if options.nil?
+ options = tmpl.recognize(pseudo)
+ next if options.kind_of? MessageMapper::Failure
auth = tmpl.options[:full_auth_path]
break
end
auth = tmpl.options[:full_auth_path]
break
end
@@ -401,8+401,12 @@ class AuthModule < CoreBotModule
return _("user list : lists all the botusers")
when "destroy"
return _("user destroy <botuser> : destroys <botuser>. This function %{highlight}must%{highlight} be called in two steps. On the first call <botuser> is queued for destruction. On the second call, which must be in the form 'user confirm destroy <botuser>', the botuser will be destroyed. If you want to cancel the destruction, issue the command 'user cancel destroy <botuser>'") % {:highlight => Bold}
return _("user list : lists all the botusers")
when "destroy"
return _("user destroy <botuser> : destroys <botuser>. This function %{highlight}must%{highlight} be called in two steps. On the first call <botuser> is queued for destruction. On the second call, which must be in the form 'user confirm destroy <botuser>', the botuser will be destroyed. If you want to cancel the destruction, issue the command 'user cancel destroy <botuser>'") % {:highlight => Bold}
+ when "export"
+ return _("user export [to <filename>]: exports user data to file <filename> (default: new-auth.users)")
+ when "import"
+ return _("user import [from <filename>]: import user data from file <filename> (default: new-auth.users)")
@bot.say nick, _("you are now registered as %{buname}. I created a random password for you : %{pass} and you can change it at any time by telling me 'user set password <password>' in private" % {
:buname => buname,
:pass => met.password
@bot.say nick, _("you are now registered as %{buname}. I created a random password for you : %{pass} and you can change it at any time by telling me 'user set password <password>' in private" % {
:buname => buname,
:pass => met.password
@@ -709,7+713,7 @@ class AuthModule < CoreBotModule
def auth_list_users(m, params)
# TODO name regexp to filter results
def auth_list_users(m, params)
# TODO name regexp to filter results
- list = @bot.auth.save_array.inject([]) { |list, x| ['everyone', 'owner'].include?(x[:username]) ? list : list << x[:username] }