From 80577042da60159661d7139fd8f4e371dc30ef01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Sun, 13 Nov 2022 00:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20`challenge`=20is=20not=20s?= =?UTF-8?q?tored=20in=20the=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 challenge 变量没有存储到 redis 缓存问题 --- plugins/genshin/sign.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/sign.py b/plugins/genshin/sign.py index 6bf8c42b..14a957c6 100644 --- a/plugins/genshin/sign.py +++ b/plugins/genshin/sign.py @@ -74,16 +74,17 @@ class SignSystem: ) -> Optional[InlineKeyboardMarkup]: if not config.pass_challenge_user_web: return None + if challenge and gt: + await self.set_challenge(uid, gt, challenge) if not challenge or not gt: gt, challenge = await self.get_challenge(uid) if not challenge or not gt: return None if callback: - await self.set_challenge(uid, gt, challenge) data = f"sign|{user_id}|{uid}" return InlineKeyboardMarkup([[InlineKeyboardButton("请尽快点我进行手动验证", callback_data=data)]]) else: - url = f"{config.pass_challenge_user_web}?username={bot.app.bot.username}>={gt}&challenge={challenge}&uid={uid}" + url = f"{config.pass_challenge_user_web}?username={bot.app.bot.username}&command=sign>={gt}&challenge={challenge}&uid={uid}" return InlineKeyboardMarkup([[InlineKeyboardButton("请尽快点我进行手动验证", url=url)]]) @staticmethod