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
if !nick
# we are actually responding to a 'hello' command
unless m.botuser.transient?
- m.reply @bot.lang.get('hello_X') % m.botuser
+ m.reply @bot.lang.get('hello_X') % m.botuser, :nick => false
return
end
nick = m.sourcenick
met = @bot.auth.make_permanent(irc_user, buname)
@bot.auth.set_changed
call_event(:botuser,:post_perm, {:irc_user => irc_user, :bot_user => buname})
- m.reply @bot.lang.get('hello_X') % met
+ m.reply @bot.lang.get('hello_X') % met, :nick => false
@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
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] }
+ list = @bot.auth.save_array.inject([]) { |lst, x| ['everyone', 'owner'].include?(x[:username]) ? lst : lst << x[:username] }
if defined?(@destroy_q)
list.map! { |x|
@destroy_q.include?(x) ? x + _(" (queued for destruction)") : x
buname = params[:name]
return m.reply(_("You can't destroy %{user}") % {:user => buname}) if
["everyone", "owner"].include?(buname)
- mod = params[:modifier].to_sym rescue nil
+ mod = params[:modifier].nil_or_empty? ? nil : params[:modifier].to_sym
buser_array = @bot.auth.save_array
buser_hash = buser_array.inject({}) { |h, u|