Added option to authenticate as another nickserv user.

This commit is contained in:
Fletcher Boyd 2013-09-05 07:28:47 +08:00
parent 8b23ba9c12
commit 73aef2e9ae
2 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,7 @@
"user": "cloudbot",
"realname": "CloudBot - http://git.io/cloudbotirc",
"nickserv_password": "",
"nickserv_user": "",
"channels": ["#cloudbot", "#cloudbot2"],
"invite_join": true,
"auto_rejoin": false,

View File

@ -22,11 +22,19 @@ def invite(paraml, conn=None):
def onjoin(paraml, conn=None, bot=None):
nickserv_password = conn.conf.get('nickserv_password', '')
nickserv_name = conn.conf.get('nickserv_name', 'nickserv')
nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY %s')
nickserv_account_name = conn.conf.get('nickserv_user', '')
nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY')
if nickserv_password:
print "Found a password..."
if nickserv_password in bot.config['censored_strings']:
bot.config['censored_strings'].remove(nickserv_password)
conn.msg(nickserv_name, nickserv_command % nickserv_password)
if nickserv_account_name:
print "Found an account name..."
print "Sending"," ".join([nickserv_command, nickserv_account_name, nickserv_password]),"to",nickserv_name
conn.msg(nickserv_name, " ".join([nickserv_command, nickserv_account_name, nickserv_password]))
else:
print "Sending"," ".join([nickserv_command, nickserv_password]),"to",nickserv_name
conn.msg(nickserv_name, " ".join([nickserv_command, nickserv_password]))
bot.config['censored_strings'].append(nickserv_password)
time.sleep(1)