1.0.0: Релиз #1

Merged
Miwory merged 15 commits from dev into latest 2025-12-17 06:31:42 +03:00
3 changed files with 83 additions and 1 deletions
Showing only changes of commit b0d3ca9add - Show all commits

View File

@ -753,7 +753,7 @@ class TwitchAPIClient(AioHTTPXClient):
cache_time: int | None = None,
):
req = await self.get(
'/emotes',
'/chat/emotes',
headers=self.clean_dict(
{
'Authorization': f'Bearer {access_token}',
@ -772,3 +772,26 @@ class TwitchAPIClient(AioHTTPXClient):
case _:
raise s.Error(req.status_code, 'Internal Server Error')
async def get_global_emotes(
self, access_token: str, cache_time: int | None = None
):
req = await self.get(
'/chat/emotes/global',
headers=self.clean_dict(
{
'Authorization': f'Bearer {access_token}',
'X-Cache-TTL': cache_time,
}
),
)
match req.status_code:
case st.OK:
return s.GlobalEmotes.model_validate(req.json())
case st.UNAUTHORIZED:
raise s.Error(req.status_code, req.json()['message'])
case _:
raise s.Error(req.status_code, 'Internal Server Error')

View File

@ -503,3 +503,7 @@ class ChannelEmotes(BaseModel):
data: list[ChannelEmote]
template: str
class GlobalEmotes(ChannelEmotes):
pass