Added option to authenticate as another nickserv user.
This commit is contained in:
parent
8b23ba9c12
commit
73aef2e9ae
2 changed files with 11 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
||||||
"user": "cloudbot",
|
"user": "cloudbot",
|
||||||
"realname": "CloudBot - http://git.io/cloudbotirc",
|
"realname": "CloudBot - http://git.io/cloudbotirc",
|
||||||
"nickserv_password": "",
|
"nickserv_password": "",
|
||||||
|
"nickserv_user": "",
|
||||||
"channels": ["#cloudbot", "#cloudbot2"],
|
"channels": ["#cloudbot", "#cloudbot2"],
|
||||||
"invite_join": true,
|
"invite_join": true,
|
||||||
"auto_rejoin": false,
|
"auto_rejoin": false,
|
||||||
|
|
|
@ -22,11 +22,19 @@ def invite(paraml, conn=None):
|
||||||
def onjoin(paraml, conn=None, bot=None):
|
def onjoin(paraml, conn=None, bot=None):
|
||||||
nickserv_password = conn.conf.get('nickserv_password', '')
|
nickserv_password = conn.conf.get('nickserv_password', '')
|
||||||
nickserv_name = conn.conf.get('nickserv_name', 'nickserv')
|
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:
|
if nickserv_password:
|
||||||
|
print "Found a password..."
|
||||||
if nickserv_password in bot.config['censored_strings']:
|
if nickserv_password in bot.config['censored_strings']:
|
||||||
bot.config['censored_strings'].remove(nickserv_password)
|
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)
|
bot.config['censored_strings'].append(nickserv_password)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
Reference in a new issue