添加不合法cookie的提示

This commit is contained in:
2024-09-06 10:08:08 +08:00
parent afd1bee762
commit 418a941448
2 changed files with 10 additions and 7 deletions
+2 -1
View File
@@ -55,8 +55,9 @@ def do_add_cookie(add_cookie: type[Matcher]):
async def got_cookie(state: T_State, cookie: Message = Arg()):
client_mgr: CookieClientManager = platform_manager[state["platform"]].site.client_mgr
cookie_text = cookie.extract_plain_text()
if not await client_mgr.valid_cookie(cookie_text):
await add_cookie.reject("无效的 Cookie,请检查后重新输入,详情见<待添加的文档>")
state["cookie"] = cookie_text
state["name"] = await client_mgr.valid_cookie(cookie_text)
@add_cookie.handle()
async def add_cookie_process(state: T_State):