From 1346d07982e2db6188f1e020cc0eac68db6ba477 Mon Sep 17 00:00:00 2001 From: suyiiyii Date: Wed, 9 Oct 2024 23:14:17 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BF=AE=E6=94=B9cookie=5Fsite.ge?= =?UTF-8?q?t=5Fcookie=5Fname=E4=B8=BA=E5=BC=82=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_bison/utils/site.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nonebot_bison/utils/site.py b/nonebot_bison/utils/site.py index 8410a45..86a1a52 100644 --- a/nonebot_bison/utils/site.py +++ b/nonebot_bison/utils/site.py @@ -68,7 +68,7 @@ class CookieClientManager(ClientManager): if not await cls.validate_cookie(content): raise ValueError() cookie = Cookie(site_name=cls._site_name, content=content) - cookie.cookie_name = cookie_site.get_cookie_name(content) + cookie.cookie_name = await cookie_site.get_cookie_name(content) cookie.cd = cls._default_cd await config.add_cookie(cookie) @@ -166,7 +166,7 @@ class CookieSite(Site): cookie_format_prompt = "无效的 Cookie,请检查后重新输入,详情见<待添加的文档>" @classmethod - def get_cookie_name(cls, content: str) -> str: + async def get_cookie_name(cls, content: str) -> str: """从cookie内容中获取cookie的友好名字,添加cookie时调用,持久化在数据库中""" from . import text_fletten