🐛 Fix redeem default uid set to None

This commit is contained in:
xtaodada 2024-06-19 18:14:14 +08:00
parent 9c886fbbe6
commit e9588a91a9
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class RedeemResult:
code: str code: str
message: Optional[Message] = None message: Optional[Message] = None
error: Optional[str] = None error: Optional[str] = None
uid: Optional[int] = 0 uid: Optional[int] = None
count: Optional[List[int]] = None count: Optional[List[int]] = None

View File

@ -38,6 +38,8 @@ class ActionLogSystem(Plugin):
async def import_action_log(self, client: "StarRailClient", authkey: str) -> bool: async def import_action_log(self, client: "StarRailClient", authkey: str) -> bool:
data = await client.get_starrail_action_log(authkey=authkey) data = await client.get_starrail_action_log(authkey=authkey)
# 确保第一个数据为登出、最后一条数据为登入 # 确保第一个数据为登出、最后一条数据为登入
if not data:
return False
if data[0].status == 1: if data[0].status == 1:
data.pop(0) data.pop(0)
if data[-1].status == 0: if data[-1].status == 0: