This commit is contained in:
2025-11-26 14:44:58 +03:00
parent e097fbab6d
commit fa2435bf8c
3 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[project]
name = "osuclient"
version = "0.5.1"
version = "0.5.2"
description = "Client for osu! API"
readme = "README.md"
authors = [

View File

@ -47,9 +47,16 @@ class osuAPIClient(AioHTTPXClient):
case _:
raise s.Error(500, 'Internal Server Error')
async def get_score(self, access_token: str, mode: str, score_id: int):
async def get_score(
self,
access_token: str,
score_id: int,
mode: Literal['fruits', 'mania', 'osu', 'taiko'] | None = None,
):
url = f'/scores/{mode}/{score_id}' if mode else f'/scores/{score_id}'
req = await self.get(
f'/scores/{mode}/{score_id}',
url,
headers=self.clean_dict(
{
'Authorization': f'Bearer {access_token}',

View File

@ -149,7 +149,7 @@ class UserAchievement(BaseModel):
class RankHistory(BaseModel):
model_config = ConfigDict(extra='forbid')
mode: str
mode: Literal['osu', 'taiko', 'fruits', 'mania']
data: list[int]
@ -331,7 +331,7 @@ class Beatmap(BaseModel):
beatmapset_id: int
difficulty_rating: float
id: int
mode: str
mode: Literal['osu', 'taiko', 'fruits', 'mania']
status: str
total_length: int
user_id: int
@ -378,7 +378,7 @@ class Score(BaseModel):
created_at: str
id: int
max_combo: int
mode: str
mode: Literal['osu', 'taiko', 'fruits', 'mania']
mode_int: int
mods: list[str]
passed: bool