From e4d67ec345c485eeafc4b073bce0e21f015be1e9 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Thu, 29 Oct 2015 12:35:43 +0100 Subject: [PATCH] Use Channel class when creating Server --- nemubot/server/IRC.py | 8 ++++---- nemubot/tools/config.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nemubot/server/IRC.py b/nemubot/server/IRC.py index 672d7af..8dff0f8 100644 --- a/nemubot/server/IRC.py +++ b/nemubot/server/IRC.py @@ -46,7 +46,7 @@ class IRC(SocketServer): realname -- the bot's realname encoding -- the encoding used on the whole server caps -- client capabilities to register on the server - channels -- list of channels to join on connection (if a channel is password protected, give a tuple: (channel_name, password)) + channels -- list of channels to join on connection on_connect -- generator to call when connection is done """ @@ -134,10 +134,10 @@ class IRC(SocketServer): self.write(oc) # Then, JOIN some channels for chn in channels: - if isinstance(chn, tuple): - self.write("JOIN %s %s" % chn) + if chn.password: + self.write("JOIN %s %s" % (chn.name, chn.password)) else: - self.write("JOIN %s" % chn) + self.write("JOIN %s" % chn.name) self.hookscmd["001"] = _on_connect # Respond to ERROR diff --git a/nemubot/tools/config.py b/nemubot/tools/config.py index 33fd3cc..f1305a7 100644 --- a/nemubot/tools/config.py +++ b/nemubot/tools/config.py @@ -132,7 +132,7 @@ class ServerConfig: self.caps += parent.caps - return factory(self.uri, **self.args) + return factory(self.uri, caps=self.caps, channels=self.channels, **self.args) class IncludeConfig: