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 221 additions and 20 deletions
Showing only changes of commit 0d9ac981b8 - Show all commits

View File

@ -857,3 +857,26 @@ class TwitchAPIClient(AioHTTPXClient):
case _:
raise s.Error(req.status_code, 'Internal Server Error')
async def get_global_chat_badges(
self, access_token: str, cache_time: int | None = None
):
req = await self.get(
'/chat/badges/global',
headers=self.clean_dict(
{
'Authorization': f'Bearer {access_token}',
'X-Cache-TTL': cache_time,
}
),
)
match req.status_code:
case st.OK:
return s.GlobalChatBadges.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

@ -537,3 +537,7 @@ class ChannelChatBadges(BaseModel):
model_config = ConfigDict(extra='forbid')
data: list[ChannelChatBadgesData]
class GlobalChatBadges(ChannelChatBadges):
pass