diff --git a/plugins/genshin/verification.py b/plugins/genshin/verification.py index 3ec5732b..e0c5345d 100644 --- a/plugins/genshin/verification.py +++ b/plugins/genshin/verification.py @@ -78,7 +78,7 @@ class VerificationPlugins(Plugin, BasePlugin): data = await verification.create(is_high=is_high) challenge = data["challenge"] gt = data["gt"] - logger.success("用户 %s[%s] 创建验证成功 gt[%s] challenge[%s]", user.full_name, user.id, gt, challenge) + logger.success("用户 %s[%s] 创建验证成功\ngt:%s\nchallenge%s", user.full_name, user.id, gt, challenge) except ResponseException as exc: logger.warning("用户 %s[%s] 创建验证失效 API返回 [%s]%s", user.full_name, user.id, exc.code, exc.message) await message.reply_text(f"创建验证失败 错误信息为 [{exc.code}]{exc.message} 请稍后重试") diff --git a/plugins/system/start.py b/plugins/system/start.py index 7fe817c0..234044cb 100644 --- a/plugins/system/start.py +++ b/plugins/system/start.py @@ -149,7 +149,7 @@ class StartPlugin(Plugin): data = await verification.create(is_high=True) challenge = data["challenge"] gt = data["gt"] - logger.success("用户 %s[%s] 创建验证成功 gt[%s] challenge[%s]", user.full_name, user.id, gt, challenge) + logger.success("用户 %s[%s] 创建验证成功\ngt:%s\nchallenge%s", user.full_name, user.id, gt, challenge) except ResponseException as exc: logger.warning("用户 %s[%s] 创建验证失效 API返回 [%s]%s", user.full_name, user.id, exc.code, exc.message) await message.reply_text(f"验证失败 错误信息为 [{exc.code}]{exc.message}") diff --git a/plugins/system/webapp.py b/plugins/system/webapp.py index 841e8868..8c0f334d 100644 --- a/plugins/system/webapp.py +++ b/plugins/system/webapp.py @@ -73,7 +73,7 @@ class WebApp(Plugin): _, challenge = await self.verification_system.get_challenge(client.uid) if challenge: logger.info( - "用户 %s[%s] 请求通过认证 challenge[%s] validate[%s] ", + "用户 %s[%s] 请求通过认证\nchallenge:%s\nvalidate:%s", user.full_name, user.id, challenge, @@ -87,7 +87,15 @@ class WebApp(Plugin): logger.warning( "用户 %s[%s] 验证失效 API返回 [%s]%s", user.full_name, user.id, exc.code, exc.message ) - await message.reply_text(f"验证失败 错误信息为 [{exc.code}]{exc.message} 请稍后重试", reply_markup=ReplyKeyboardRemove()) + if "拼图已过期" in exc.message: + await message.reply_text( + "验证失败,拼图已过期,请稍后重试或更换使用环境进行验证", reply_markup=ReplyKeyboardRemove() + ) + else: + await message.reply_text( + f"验证失败,错误信息为 [{exc.code}]{exc.message},请稍后重试", + reply_markup=ReplyKeyboardRemove(), + ) else: logger.warning("用户 %s[%s] 验证失效 请求已经过期", user.full_name, user.id) await message.reply_text("验证失效 请求已经过期 请稍后重试", reply_markup=ReplyKeyboardRemove()) @@ -104,10 +112,12 @@ class WebApp(Plugin): data = await verification.create(is_high=True) challenge = data["challenge"] gt = data["gt"] - logger.success("用户 %s[%s] 创建验证成功 gt[%s] challenge[%s]", user.full_name, user.id, gt, challenge) + logger.success("用户 %s[%s] 创建验证成功\ngt:%s\nchallenge%s", user.full_name, user.id, gt, challenge) except ResponseException as exc: logger.warning("用户 %s[%s] 创建验证失效 API返回 [%s]%s", user.full_name, user.id, exc.code, exc.message) - await message.reply_text(f"创建验证失败 错误信息为 [{exc.code}]{exc.message} 请稍后重试", reply_markup=ReplyKeyboardRemove()) + await message.reply_text( + f"创建验证失败 错误信息为 [{exc.code}]{exc.message} 请稍后重试", reply_markup=ReplyKeyboardRemove() + ) return await self.verification_system.set_challenge(client.uid, gt, challenge) url = f"{config.pass_challenge_user_web}/webapp?username={context.bot.username}&command=verify>={gt}&challenge={challenge}&uid={client.uid}"