2023-06-09 03:48:56 +00:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
from simnet.client.components.diary.base import BaseDiaryClient
|
|
|
|
from simnet.models.starrail.diary import StarRailDiary
|
|
|
|
from simnet.utils.enum_ import Game
|
|
|
|
|
|
|
|
|
|
|
|
class StarrailDiaryClient(BaseDiaryClient):
|
|
|
|
"""Starrail diary component."""
|
|
|
|
|
|
|
|
async def get_starrail_diary(
|
|
|
|
self,
|
|
|
|
player_id: Optional[int] = None,
|
|
|
|
*,
|
2023-06-23 14:54:42 +00:00
|
|
|
month: Optional[str] = None,
|
2023-06-09 03:48:56 +00:00
|
|
|
lang: Optional[str] = None,
|
|
|
|
) -> StarRailDiary:
|
|
|
|
"""Get a traveler's diary with earning details for the month.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
player_id (int, optional): The player's ID. Defaults to None.
|
|
|
|
month (int, optional): The month to get the diary for. Defaults to None.
|
|
|
|
lang (str, optional): The language to get the diary in. Defaults to None.
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Diary: The diary for the month.
|
|
|
|
"""
|
|
|
|
data = await self.request_ledger(player_id, game=Game.STARRAIL, month=month, lang=lang)
|
|
|
|
return StarRailDiary(**data)
|