Skip to content

Commit

Permalink
✨ Support starrail set avatar recommend property
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao authored Feb 7, 2024
1 parent c4e3ec1 commit 4e03740
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion simnet/client/components/chronicle/starrail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asyncio
from typing import Optional, Mapping, Dict, Any, Union
from typing import Optional, Mapping, Dict, Any, Union, List

from simnet.client.components.chronicle.base import BaseChronicleClient
from simnet.client.routes import RECORD_URL
Expand Down Expand Up @@ -413,3 +413,23 @@ async def get_starrail_notes_by_stoken(
data = await self._request_starrail_record("widget", endpoint_type="aapi", lang=lang)
model = StarRailNoteWidget
return model(**data)

async def set_starrail_avatar_recommend_property(
self,
avatar_id: int,
recommend_relic_properties: List[int] = None,
) -> None:
"""Set StarRail avatar recommend properties.
Args:
avatar_id (int): The avatar ID.
recommend_relic_properties (List[int], optional): The recommend relic properties. Defaults to None.
Raises:
InternalDatabaseError: If the request is invalid.
"""
payload = dict(
avatar_id=avatar_id,
recommend_relic_properties=recommend_relic_properties or [],
)
await self._request_starrail_record("setAvatarRecommendRelicProperty", method="POST", payload=payload)

0 comments on commit 4e03740

Please sign in to comment.