Merge pull request #22 from archangelic/mh/server-password

implement server password
pull/23/head
M. Hancock 2018-02-05 13:07:46 -08:00 committed by GitHub
commit 8e88b21516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -33,9 +33,9 @@ class Bot(irc.bot.SingleServerIRCBot):
self.set_kwargs(**kwargs) self.set_kwargs(**kwargs)
if self.ssl_required: if self.ssl_required:
factory = irc.connection.Factory(wrapper=ssl.wrap_socket) factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port)], nickname, nickname, connect_factory=factory) irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port, self.server_pass)], nickname, nickname, connect_factory=factory)
else: else:
irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port)], nickname, nickname) irc.bot.SingleServerIRCBot.__init__(self, [(server, self.port, self.server_pass)], nickname, nickname)
self.chanlist = channels self.chanlist = channels
self.bot_nick = nickname self.bot_nick = nickname
self.start_logging(self.log_level) self.start_logging(self.log_level)
@ -50,6 +50,7 @@ class Bot(irc.bot.SingleServerIRCBot):
'ns_pass': None, 'ns_pass': None,
'nickserv': 'NickServ', 'nickserv': 'NickServ',
'log_level': 'info', 'log_level': 'info',
'server_pass': None,
} }
for k, v in kwargs.items(): for k, v in kwargs.items():
setattr(self, k, v) setattr(self, k, v)