# Automatically auths with Q on QuakeNet servers
class QPlugin < Plugin
-
+
def help(plugin, topic="")
case topic
when ""
return "qauth register <email>: register with Q, an email on how to proceed will be sent to the email address you provide"
end
end
-
+
def initialize
super
# this plugin only wants to store strings!
@registry['quakenet.auth'] = params[:password]
m.okay
end
-
+
def connect
- identify(nil, nil)
+ identify(nil, {}) if on_quakenet?
end
def identify(m, params)
@bot.say @source, "username or password incorrect" if @source
when /you are now logged in/i
@bot.say @source, "authed successfully" if @source
+ @bot.plugins.delegate('identified')
when /auth is not available/
@bot.say @source, "already authed" if @source
end