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

TypeError: __api_get_request() got an unexpected keyword argument 'body' #217

Closed JC-Chung closed 1 year ago

JC-Chung commented 1 year ago
Traceback (most recent call last):
  File "a.py", line 507, in <module>
    asyncio.get_event_loop().run_until_complete(main_twitch())
  File "Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "a.py", line 231, in main
    await asyncio.gather(
  File "a.py", line 148, in twitch_followers_count
    user_follows_data = [_.to_dict() async for _ in await twitch.get_users_follows(first=100, to_id=twitch_user_id)]
  File "a.py", line 148, in <listcomp>
    user_follows_data = [_.to_dict() async for _ in await twitch.get_users_follows(first=100, to_id=twitch_user_id)]
  File "Python39\lib\site-packages\twitchAPI\object.py", line 188, in __anext__
    response = await self._data['req'](session, _url, self._data['auth_t'], self._data['auth_s'], body=self._data['body'])
TypeError: __api_get_request() got an unexpected keyword argument 'body'

https://github.com/Teekeks/pyTwitchAPI/blob/master/twitchAPI/twitch.py#L486 The argument to __api_get_request is data instead of body, so it should be changed to

response = await self._data['req'](session, _url, self._data['auth_t'], self._data['auth_s'], data=self._data['body'])
or
response = await self._data['req'](session, _url, self._data['auth_t'], self._data['auth_s'], self._data['body'])
or
...?