Добавлен эндпоинт get_channel_emotes

This commit is contained in:
2025-12-11 16:13:06 +03:00
parent e437b41ee8
commit 947f19afbc
2 changed files with 45 additions and 0 deletions

View File

@ -745,3 +745,20 @@ class TwitchAPIClient(AioHTTPXClient):
case _:
raise s.Error(req.status_code, 'Internal Server Error')
async def get_channel_emotes(self, access_token: str, broadcaster_id: int):
req = await self.get(
'/emotes',
headers={'Authorization': f'Bearer {access_token}'},
params={'broadcaster_id': broadcaster_id},
)
match req.status_code:
case st.OK:
return s.ChannelEmotes.model_validate(req.json())
case st.BAD_REQUEST | st.UNAUTHORIZED:
raise s.Error(req.status_code, req.json()['message'])
case _:
raise s.Error(req.status_code, 'Internal Server Error')