How to use the twitchapi.db_models.Chatter 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 / currency_handler.py View on Github external
chatters.append(mod)
        for viewer in latest['chatters']['viewers']:
            chatters.append(viewer)
        for global_mod in latest['chatters']['global_mods']:
            chatters.append(global_mod)
        for admin in latest['chatters']['admins']:
            chatters.append(admin)

        for chatter in chatters:
            chatterDbCheck = session.query(db_models.Chatter).filter(
                    db_models.Chatter.name == chatter).first()
            if chatterDbCheck:
                chatterDbCheck.currency += 1
                chatterDbCheck.totalMinutes += 1
            else: 
                newChatter = db_models.Chatter(
                        name = chatter,
                        currency = 1,
                        totalMinutes = 1,
                        follower = False) 
                session.add(newChatter)
        session.commit()
        print("New points doled out at: " , time.time())
        time.sleep(60)

twitchAPI

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

MIT
Latest version published 3 days ago

Package Health Score

73 / 100
Full package analysis

Similar packages