How to use the twitchapi.krakenv5.channels function in twitchAPI

To help you get started, we’ve selected a few twitchAPI examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Amperture / twitch-sbc-integration / twitchapi / twitchapirun.py View on Github external
def checkForNewFollower(channel, q_twitchbeagle, logger):
    try:
        followers = channels.getChannelFollowers(channel)
        latestDisplay = followers["follows"][0]['user']['display_name'].encode(
                'utf-8')
        latestUsername = followers["follows"][0]['user']['name']
        latestId = followers["follows"][0]['user']['_id']
        print("FOLLOWCHECK", latestDisplay, latestUsername, latestId)

        event = {
                'eventType' : 'currency',
                'event'     : 'follower %d %s %s' %(latestId, 
                    latestUsername, latestDisplay)
        }

        q_twitchbeagle.put(event)
    except Exception,e:
        logger.error(str(e))
        logger.error(traceback.format_exc())

twitchAPI

A Python 3.7+ implementation of the Twitch Helix API, PubSub, EventSub and Chat

MIT
Latest version published 4 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages