🐛 Fix wrong params passed to start_sign function

修复签到函数传入错误的参数导致异常的问题
This commit is contained in:
洛水居室 2022-10-31 15:43:51 +08:00
parent 15d872ba35
commit 11be3f232c
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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