Closed RobertErobert closed 3 years ago
When i use force=True i got following:
Traceback (most recent call last):
File "C:\Users\rober\Google Drive\Twitch\Code\djwindless-chatbot-v2\virtual_env_3_8\lib\site-packages\twitchio\client.py", line 190, in wrapped
await func(*args)
File ".\minimal.py", line 27, in event_ready
custom_rewards = await self.channel_user.get_custom_rewards(token=os.getenv('ACCESS_TOKEN_DJWINDLESS').replace('oauth:', ''), force=True)
File "C:\Users\rober\Google Drive\Twitch\Code\djwindless-chatbot-v2\virtual_env_3_8\lib\site-packages\twitchio\user.py", line 174, in get_custom_rewards
values = [CustomReward(self._http, x, self) for x in data]
File "C:\Users\rober\Google Drive\Twitch\Code\djwindless-chatbot-v2\virtual_env_3_8\lib\site-packages\twitchio\user.py", line 174, in <listcomp>
values = [CustomReward(self._http, x, self) for x in data]
File "C:\Users\rober\Google Drive\Twitch\Code\djwindless-chatbot-v2\virtual_env_3_8\lib\site-packages\twitchio\rewards.py", line 70, in __init__
self._broadcaster_id = obj["channel_id"]
KeyError: 'channel_id'
channel_id
is not in the response from twitch:
{
'broadcaster_name': 'DJWindless',
'broadcaster_login': 'djwindless',
'broadcaster_id': '175202019',
'id': '0ddbccb7-58f9-460b-9850-4de8d5ccf9a2',
'image': {
'url_1x': 'https://static-cdn.jtvnw.net/custom-reward-images/175202019/0ddbccb7-58f9-460b-9850-4de8d5ccf9a2/0391c292-c535-43ad-b89a-42d5c434a4b1/custom-1.png',
'url_2x': 'https://static-cdn.jtvnw.net/custom-reward-images/175202019/0ddbccb7-58f9-460b-9850-4de8d5ccf9a2/0391c292-c535-43ad-b89a-42d5c434a4b1/custom-2.png',
'url_4x': 'https://static-cdn.jtvnw.net/custom-reward-images/175202019/0ddbccb7-58f9-460b-9850-4de8d5ccf9a2/0391c292-c535-43ad-b89a-42d5c434a4b1/custom-4.png'
},
'background_color': '#9146FF',
'is_enabled': False,
'cost': 50000,
'title': 'DJ du hast ein Horn',
'prompt': '10 Minuten Einhorn Mütze',
'is_user_input_required': False,
'max_per_stream_setting': {
'is_enabled': True,
'max_per_stream': 1
},
'max_per_user_per_stream_setting': {
'is_enabled': True,
'max_per_user_per_stream': 1
},
'global_cooldown_setting': {
'is_enabled': False,
'global_cooldown_seconds': 0
},
'is_paused': False,
'is_in_stock': False,
'default_image': {
'url_1x': 'https://static-cdn.jtvnw.net/custom-reward-images/default-1.png',
'url_2x': 'https://static-cdn.jtvnw.net/custom-reward-images/default-2.png',
'url_4x': 'https://static-cdn.jtvnw.net/custom-reward-images/default-4.png'
},
'should_redemptions_skip_request_queue': False,
'redemptions_redeemed_current_stream': None,
'cooldown_expires_at': None
}
I want to get all custom rewards and then iterate over them.
I am on the master branch.
Thats my code:
Thats the traceback: