Teekeks / pyTwitchAPI

A Python 3.7 compatible implementation of the Twitch API, EventSub, PubSub and Chat
https://pytwitchapi.dev
MIT License
254 stars 38 forks source link

Upgraded from 2.5.7 to 3.8.0, errors #218

Closed gitagogaming closed 1 year ago

gitagogaming commented 1 year ago

Clearly I've been a bit behind on keeping up to date it appears and today I decided to get the most recent version.

So after the upgrade I immediately starting having issues with everything.

1) data = twitch.get_users(logins=[broadcaster_username_TP])

2) When I manually set the broadcaster_id I then get another error when checking the token for this user, and its very similar.

    check_token = validate_token(current_token) 

    is_error = check_token.get('message')
    expires_in = check_token.get('expires_in')

the error it shows is AttributeError: 'coroutine' object has no attribute 'get'

and when I bypass this error, again I am getting TypeError: 'coroutine' object is not subscriptable in other spots..

Does anyone know what may be causing this all thruout my program now?

stolenvw commented 1 year ago

most things that returned a dictionary now return an object. everything is now async so you need to await alot of the function calls.

You might want to take a look at the V2 to V3 migration guid

https://pytwitchapi.readthedocs.io/en/stable/v3-migration.html

Braastos commented 1 year ago

Just as a friendly Information, for future projects of yours: If a library bumps its major version number (like happened here from 2 to 3) its normaly combined with breaking changes.

There are exceptions to this rule. Some Libs don't include breaking changes with a major version bump, others have it with a minor version.