Merge pull request #725 from RockChinQ/feat/aiocqhttp-access-token

Feat: aiocqhttp支持access-token
This commit is contained in:
Junyan Qin
2024-03-13 16:49:56 +08:00
committed by GitHub

View File

@@ -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