Allow to join multiple channels

master
Nikola Forró 7 years ago
parent c75ee6f957
commit 6c16566ee0

@ -66,7 +66,6 @@ class TwitchBot(irc.bot.SingleServerIRCBot):
self.server = config['IRC'].get('server', 'irc.chat.twitch.tv')
self.port = config['IRC'].getint('port', 6667)
self.nickname = config['IRC'].get('nickname')
self.channel = '#{0}'.format(config['IRC'].get('channel'))
self.token = config['Twitch'].get('token')
self.master_user_id = config['Twitch'].getint('master_user_id')
self.api_url = config['Quotes'].get('api_url')
@ -94,8 +93,10 @@ class TwitchBot(irc.bot.SingleServerIRCBot):
connection.cap('REQ', ':twitch.tv/membership')
connection.cap('REQ', ':twitch.tv/tags')
connection.cap('REQ', ':twitch.tv/commands')
log.info('Joining %s', self.channel)
connection.join(self.channel)
for channel in config['IRC'].get('channels').split(','):
channel = '#{0}'.format(channel)
log.info('Joining %s', channel)
connection.join(channel)
def on_join(self, connection, event):
log.info('Joined %s', event.target)

@ -2,7 +2,7 @@
server = irc.chat.twitch.tv
port = 6667
nickname = spooky_lurker
channel = lilialil
channels = lilialil
[Instagram]
username = lilialovesgames

Loading…
Cancel
Save