From 11be3f232ce56e70de3cc52476cfa3331ef5db3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Mon, 31 Oct 2022 15:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20wrong=20params=20passed=20?= =?UTF-8?q?to=20`start=5Fsign`=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复签到函数传入错误的参数导致异常的问题 --- plugins/jobs/sign.py | 4 +++- plugins/system/sign_all.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/jobs/sign.py b/plugins/jobs/sign.py index 88a724c..f28f26c 100644 --- a/plugins/jobs/sign.py +++ b/plugins/jobs/sign.py @@ -16,6 +16,7 @@ from core.user import UserService from plugins.genshin.sign import SignSystem, NeedChallenge from plugins.system.errorhandler import notice_chat_id from plugins.system.sign_status import SignStatus +from utils.helpers import get_genshin_client from utils.log import logger @@ -51,8 +52,9 @@ class SignJob(Plugin): if sign_db.status in [SignStatusEnum.STATUS_SUCCESS, SignStatusEnum.ALREADY_CLAIMED]: continue try: + client = await get_genshin_client(user_id) text = await self.sign_system.start_sign( - user_id, is_sleep=True, is_raise=True, title="自动签到" if context.job.name == "SignJob" else "自动重新签到" + client, is_sleep=True, is_raise=True, title="自动签到" if context.job.name == "SignJob" else "自动重新签到" ) sign_db.status = SignStatusEnum.STATUS_SUCCESS except InvalidCookies: diff --git a/plugins/system/sign_all.py b/plugins/system/sign_all.py index 167c73e..e0f8970 100644 --- a/plugins/system/sign_all.py +++ b/plugins/system/sign_all.py @@ -16,6 +16,7 @@ from core.user import UserService from plugins.genshin.sign import SignSystem from plugins.jobs.sign import NeedChallenge from utils.decorators.admins import bot_admins_rights_check +from utils.helpers import get_genshin_client from utils.log import logger @@ -44,7 +45,8 @@ class SignAll(Plugin): user_id = sign_db.user_id old_status = sign_db.status try: - text = await self.sign_system.start_sign(user_id, is_sleep=True, is_raise=True, title="自动重新签到") + client = await get_genshin_client(user_id) + text = await self.sign_system.start_sign(client, is_sleep=True, is_raise=True, title="自动重新签到") except InvalidCookies: text = "自动签到执行失败,Cookie无效" sign_db.status = SignStatusEnum.INVALID_COOKIES