Skip to content

Commit f3f8422

Browse files
author
bspkrs
committed
stop getting nickserv pass from cli args
1 parent 7437b48 commit f3f8422

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

BotBase.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def run(self):
8282

8383

8484
class BotBase(object):
85-
def __init__(self, configfile=None, nspass=None, backupcfg=False):
85+
def __init__(self, configfile=None, backupcfg=False):
8686
self.configfile = configfile if configfile else 'bot.cfg'
8787
self.backupcfg = backupcfg
8888

@@ -93,8 +93,6 @@ def __init__(self, configfile=None, nspass=None, backupcfg=False):
9393
self.config = AdvConfigParser()
9494
self.config.read(self.configfile)
9595

96-
self.nspass = nspass
97-
9896
self.host = self.config.get('SERVER', 'HOST', '')
9997
self.port = self.config.geti('SERVER', 'PORT', '6667')
10098
self.channels = set(self.config.get('SERVER','CHANNELS', "").split(';') if self.config.get('SERVER','CHANNELS', "").strip() else [])
@@ -110,6 +108,7 @@ def __init__(self, configfile=None, nspass=None, backupcfg=False):
110108
self.nsreply = self.config.get('NICKSERV', 'NSREPLY', "PRIVMSG {nickserv} :identify {nspass}", 'Reply to an identify request')
111109

112110
self.nick = self.config.get('BOT', 'NICK', "PyBot")
111+
self.nspass = self.config.get('BOT', 'NICKSERV_PASS', '')
113112
self.cmdChar = self.config.get('BOT', 'CMDCHAR', "*")
114113
self.moreCount = self.config.geti('BOT', 'MORECMDCOUNT', '10', 'The number of queued messages to send each time a user executes the more command.')
115114
self.moreCountDcc= self.config.geti('BOT', 'MORECMDCOUNTDCC', '100', 'The number of queued messages to send each time a user executes the more command in a DCC session.')

MCPBot.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
import zipfile, os, re
1212
import psycopg2.extras
1313

14-
__version__ = "0.10.1"
14+
__version__ = "0.10.2"
1515

1616
class MCPBot(BotBase):
17-
def __init__(self, configfile=None, nspass=None, backupcfg=False):
18-
super(MCPBot, self).__init__(configfile=configfile, nspass=nspass, backupcfg=backupcfg)
17+
def __init__(self, configfile=None, backupcfg=False):
18+
super(MCPBot, self).__init__(configfile=configfile, backupcfg=backupcfg)
1919

2020
self.dbhost = self.config.get('DATABASE', 'HOST', "")
2121
self.dbport = self.config.geti('DATABASE', 'PORT', "0")
@@ -1059,7 +1059,6 @@ def main():
10591059

10601060
parser = OptionParser(version='%prog ' + __version__,
10611061
usage="%prog [options]")
1062-
parser.add_option('-N', '--ns-pass', default=None, help='The NICKSERV password to use.')
10631062
parser.add_option('-C', '--config', default=None, help='The config filename to use.')
10641063
parser.add_option('-B', '--backup-config', default=False, action='store_true', help='Creates a backup of the config file prior to running [default: %default]')
10651064
parser.add_option('-W', '--wait', default='15', help='Number of seconds to wait when attempting to restore the IRC connection [default: %default]')
@@ -1068,7 +1067,7 @@ def main():
10681067

10691068
options, args = parser.parse_args()
10701069

1071-
BotHandler(MCPBot(configfile=options.config, nspass=options.ns_pass, backupcfg=options.backup_config),
1070+
BotHandler(MCPBot(configfile=options.config, backupcfg=options.backup_config),
10721071
reconnect_wait=int(options.wait), reset_attempt_secs=int(options.reset_attempts_time),
10731072
max_reconnects=int(options.max_reconnects))\
10741073
.start().run()

0 commit comments

Comments
 (0)