def auth_meet(m, params)
nick = params[:nick]
if !nick
unless m.botuser.transient?
m.reply @bot.lang.get('hello_X') % m.botuser
return
end
nick = m.sourcenick
irc_user = m.source
else
irc_user = m.channel.users[nick]
return m.reply("I don't see anyone named '#{nick}' here") unless irc_user
end
buname = params[:user] || nick
begin
call_event(:botuser,:pre_perm, {:irc_user => irc_user, :bot_user => buname})
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
@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
})
rescue RuntimeError
m.reply _("but I already know %{buname}" % {:buname => buname})
rescue => e
m.reply _("I had problems meeting %{nick}: %{e}" % { :nick => nick, :e => e })
end
end