From 54a85e0212b5fa7a4c62b83664715cb2081d850f Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 11 Oct 2024 10:35:07 +0800 Subject: [PATCH] :bug: Remove specify the default game parameter --- plugins/tools/sign.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/tools/sign.py b/plugins/tools/sign.py index 59d80f5..bc67778 100644 --- a/plugins/tools/sign.py +++ b/plugins/tools/sign.py @@ -6,7 +6,6 @@ from enum import Enum from typing import Optional, Tuple, List, TYPE_CHECKING from httpx import TimeoutException -from simnet import Game from simnet.errors import BadRequest as SimnetBadRequest, AlreadyClaimed, InvalidCookies, TimedOut as SimnetTimedOut from simnet.utils.player import recognize_starrail_server from sqlalchemy.orm.exc import StaleDataError @@ -119,14 +118,14 @@ class SignSystem(Plugin): else: await asyncio.sleep(random.randint(0, 3)) # nosec try: - rewards = await client.get_monthly_rewards(game=Game.STARRAIL, lang="zh-cn") + rewards = await client.get_monthly_rewards(lang="zh-cn") except SimnetBadRequest as error: logger.warning("UID[%s] 获取签到信息失败,API返回信息为 %s", client.player_id, str(error)) if is_raise: raise error return f"获取签到信息失败,API返回信息为 {str(error)}" try: - daily_reward_info = await client.get_reward_info(game=Game.STARRAIL, lang="zh-cn") # 获取签到信息失败 + daily_reward_info = await client.get_reward_info(lang="zh-cn") # 获取签到信息失败 except SimnetBadRequest as error: logger.warning("UID[%s] 获取签到状态失败,API返回信息为 %s", client.player_id, str(error)) if is_raise: @@ -141,7 +140,6 @@ class SignSystem(Plugin): request_daily_reward = await client.request_daily_reward( "sign", method="POST", - game=Game.STARRAIL, lang="zh-cn", challenge=challenge, validate=validate, @@ -163,7 +161,6 @@ class SignSystem(Plugin): request_daily_reward = await client.request_daily_reward( "sign", method="POST", - game=Game.STARRAIL, lang="zh-cn", challenge=challenge, validate=validate, @@ -183,7 +180,6 @@ class SignSystem(Plugin): _request_daily_reward = await client.request_daily_reward( "sign", method="POST", - game=Game.STARRAIL, lang="zh-cn", ) logger.debug("request_daily_reward 返回\n%s", _request_daily_reward) @@ -199,7 +195,6 @@ class SignSystem(Plugin): request_daily_reward = await client.request_daily_reward( "sign", method="POST", - game=Game.STARRAIL, lang="zh-cn", challenge=_challenge, validate=_validate, @@ -219,7 +214,7 @@ class SignSystem(Plugin): logger.success("UID[%s] 通过 recognize 签到成功", client.player_id) else: request_daily_reward = await client.request_daily_reward( - "sign", method="POST", game=Game.STARRAIL, lang="zh-cn" + "sign", method="POST", lang="zh-cn" ) gt = request_daily_reward.get("gt", "") challenge = request_daily_reward.get("challenge", "") @@ -228,9 +223,7 @@ class SignSystem(Plugin): ) raise NeedChallenge(uid=client.player_id, gt=gt, challenge=challenge) else: - request_daily_reward = await client.request_daily_reward( - "sign", method="POST", game=Game.STARRAIL, lang="zh-cn" - ) + request_daily_reward = await client.request_daily_reward("sign", method="POST", lang="zh-cn") gt = request_daily_reward.get("gt", "") challenge = request_daily_reward.get("challenge", "") logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.player_id, gt, challenge)