From d66577e6c3be0b5e600511bacc93dc8d1f30d335 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Wed, 13 Mar 2024 16:49:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20aiocqhttp=E6=94=AF=E6=8C=81access-token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/platform/sources/aiocqhttp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/platform/sources/aiocqhttp.py b/pkg/platform/sources/aiocqhttp.py index 39506d33..6eaa6ce9 100644 --- a/pkg/platform/sources/aiocqhttp.py +++ b/pkg/platform/sources/aiocqhttp.py @@ -216,7 +216,11 @@ class AiocqhttpAdapter(adapter.MessageSourceAdapter): self.ap = ap - self.bot = aiocqhttp.CQHttp() + if "access-token" in config and config["access-token"]: + self.bot = aiocqhttp.CQHttp(access_token=config["access-token"]) + del self.config["access-token"] + else: + self.bot = aiocqhttp.CQHttp() async def send_message( self, target_type: str, target_id: str, message: mirai.MessageChain