implement server password

pull/22/head
Mallory Hancock 2018-02-05 12:33:44 -08:00
parent 97316c750b
commit 3cf1c6d02a
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)