Exemple #1
0
class BTTVEmoteManager:
    def __init__(self, emote_manager):
        from tyggbot.apiwrappers import BTTVApi
        self.emote_manager = emote_manager
        self.bttv_api = BTTVApi()

    def update_emotes(self):
        log.debug('Updating BTTV Emotes...')
        emotes = self.bttv_api.get_global_emotes()
        emotes += self.bttv_api.get_channel_emotes(self.emote_manager.streamer)

        self.emote_manager.bot.mainthread_queue.add(self._add_bttv_emotes,
                                                    args=[emotes])

    def _add_bttv_emotes(self, emotes):
        for emote in emotes:
            key = 'custom_{}'.format(emote['code'])
            if key in self.emote_manager.data:
                self.emote_manager.data[key].emote_hash = emote['emote_hash']
            else:
                self.emote_manager.add_emote(**emote)
        log.debug('Added {} emotes'.format(len(emotes)))
Exemple #2
0
class BTTVEmoteManager:
    def __init__(self, emote_manager):
        from tyggbot.apiwrappers import BTTVApi
        self.emote_manager = emote_manager
        self.bttv_api = BTTVApi()

    def update_emotes(self):
        log.debug('Updating BTTV Emotes...')
        emotes = self.bttv_api.get_global_emotes()
        emotes += self.bttv_api.get_channel_emotes(self.emote_manager.streamer)

        self.emote_manager.bot.mainthread_queue.add(self._add_bttv_emotes,
                                                    args=[emotes])

    def _add_bttv_emotes(self, emotes):
        for emote in emotes:
            key = 'custom_{}'.format(emote['code'])
            if key in self.emote_manager.data:
                self.emote_manager.data[key].emote_hash = emote['emote_hash']
            else:
                self.emote_manager.add_emote(**emote)
        log.debug('Added {} emotes'.format(len(emotes)))
Exemple #3
0
 def __init__(self, emote_manager):
     from tyggbot.apiwrappers import BTTVApi
     self.emote_manager = emote_manager
     self.bttv_api = BTTVApi()
Exemple #4
0
 def __init__(self, emote_manager):
     from tyggbot.apiwrappers import BTTVApi
     self.emote_manager = emote_manager
     self.bttv_api = BTTVApi()