mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🎨 Update verification reply text and log
This commit is contained in:
parent
2b83985efd
commit
c4db39c3df
@ -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} 请稍后重试")
|
||||
|
@ -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}")
|
||||
|
@ -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}"
|
||||
|
Loading…
Reference in New Issue
Block a user