def __init__(self, bot): super().__init__(bot) self.connection_manager = ConnectionManager(self.bot.reactor, self.bot, TMI.message_limit, streamer=self.bot.streamer) chub = self.bot.config['main'].get('control_hub', None) if chub is not None: self.control_hub = ConnectionManager(self.bot.reactor, self.bot, TMI.message_limit, streamer=chub, backup_conns=1) else: self.control_hub = None # XXX self.bot.execute_every( 30, lambda: self.connection_manager.get_main_conn().ping( 'tmi.twitch.tv')) self.whisper_manager = WhisperConnectionManager( self.bot.reactor, self.bot, self.bot.streamer, TMI.whispers_message_limit, TMI.whispers_limit_interval) self.whisper_manager.start(accounts=[{ 'username': self.username, 'oauth': self.password, 'can_send_whispers': self.bot.config.getboolean('main', 'add_self_as_whisper_account') }])
def __init__(self, bot): self.bot = bot self.username = self.bot.nickname self.password = self.bot.password self.channels = [] self.channel = "#" + self.bot.streamer self.channels.append(self.channel) self.control_hub_channel = self.bot.config["main"].get( "control_hub", None) if self.control_hub_channel: self.control_hub_channel = "#" + self.control_hub_channel self.channels.append(self.control_hub_channel) chub = bot.config["main"].get("control_hub", "") self.connection_manager = ConnectionManager( self.bot.reactor, self.bot, streamer=self.bot.streamer, control_hub_channel=chub, host="irc.chat.twitch.tv", port=6697, )
def __init__(self, bot): super().__init__(bot) chub = self.bot.config["main"].get("control_hub", "") self.connection_manager = ConnectionManager( self.bot.reactor, self.bot, streamer=self.bot.streamer, control_hub_channel=chub ) # XXX self.bot.execute_every(30, lambda: self.connection_manager.get_main_conn().ping("tmi.twitch.tv"))