PythonistaGuild / TwitchIO

An Async Bot/API wrapper for Twitch made in Python.
https://twitchio.dev
MIT License
791 stars 163 forks source link

Get Streams API Bug #365

Closed sabal202 closed 1 year ago

sabal202 commented 1 year ago

Issues

Background: I wanted to get top live streams by chosen languages.

Issues I encountered:

  1. In TwitchHTTP class function get_streams does not provide type parameter (link).

    As said in twitch dev reference Get streams have parameter type:

    The type of stream to filter the list of streams by. Possible values are: all, live.
    The default is all.
  2. In Client fetch_streams function also does not have type parameter, but also introduce assert user_ids or game_ids or user_logins (link). This assert prohibits use of only languages parameter and none of parameters while twitch API allows that behavior.

Possible solution

  1. Add type: Optional[Literal["all", "live"]] = None to both Client.fetch_streams and TwitchHTTP.get_streams as argument.
  2. Remove assert from Client.fetch_streams.
github-actions[bot] commented 1 year ago

Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server

Else if you have an issue with the library please wait for someone to help you here.

IAmTomahawkx commented 1 year ago

fixed!