Closed ccppoo closed 2 years 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.
Twitch does indeed send these as empty strings rather than None or null type and the models reflect this, as per their documentation.
'game_id': '', 'game_name': '', 'type': 'live',
Whether we change the model to make these Optional or not and return None by simply adding or None
, or a property, to the model will need to be discussed, or left as a change for 3.0
@chillymosh
yes, it will be better using @property
decorators saving origin values(str) and then handling,
such as type casting string to int or empty string to None
could be more useful for future maintenance
so does issue https://github.com/TwitchIO/TwitchIO/issues/325 and https://github.com/TwitchIO/TwitchIO/issues/324
We will not be changing this, as it is true to the API, and changes made to turn this to None or whatever constitute a breaking change.
Not in the docs, nor TwitchIO Doc somebody just getting a exception not knowing what just happend in runtime and you are saying API is working fine all time
There are cases where streamer didn't set their game_name while streaming.
Unlike Twitch System automatically generates
Tags
after few seconds like I mentioned at https://github.com/TwitchIO/TwitchIO/issues/324 ,game_id
,game_name
weren't generated until the streamer changes it.There was no explanations in case of
game_id
andgame_name
sent as empty string in Twitch API Doc.and couldn't find other cases like this in blogs, stackoverflow questions.