From 73aef2e9ae305e7111f3cf35be62e801913efabd Mon Sep 17 00:00:00 2001 From: Fletcher Boyd Date: Thu, 5 Sep 2013 07:28:47 +0800 Subject: [PATCH] Added option to authenticate as another nickserv user. --- config.default | 1 + plugins/core_misc.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config.default b/config.default index 43fb526..824cfd1 100644 --- a/config.default +++ b/config.default @@ -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, diff --git a/plugins/core_misc.py b/plugins/core_misc.py index 4fb082f..5e075a9 100755 --- a/plugins/core_misc.py +++ b/plugins/core_misc.py @@ -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)