From ba48185f99c33f2049937b4f7d6d50a65acd0605 Mon Sep 17 00:00:00 2001 From: LWR Date: Tue, 8 Aug 2023 20:52:44 +0800 Subject: [PATCH] feat: Custom mirai verify key support --- starbot/core/sender.py | 2 +- starbot/utils/config.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/starbot/core/sender.py b/starbot/core/sender.py index 302bd1b..2bd5631 100644 --- a/starbot/core/sender.py +++ b/starbot/core/sender.py @@ -52,7 +52,7 @@ class Bot(BaseModel): self.__bot = Ariadne( connection=AriadneConfig( self.qq, - "StarBot", + config.get('MIRAI_KEY'), HttpClientConfig(host=f"http://{config.get('MIRAI_HOST')}:{config.get('MIRAI_PORT')}"), WebsocketClientConfig(host=f"http://{config.get('MIRAI_HOST')}:{config.get('MIRAI_PORT')}"), ), diff --git a/starbot/utils/config.py b/starbot/utils/config.py index 115c55c..c7c37a2 100644 --- a/starbot/utils/config.py +++ b/starbot/utils/config.py @@ -28,10 +28,12 @@ DEFAULT_CONFIG = { # MySQL 数据库名 "MYSQL_DB": "starbot", - # Mirai API HTTP 及 Websocket 地址 + # Mirai API HTTP 连接地址 "MIRAI_HOST": "localhost", - # Mirai API HTTP 及 Websocket 端口 + # Mirai API HTTP 连接端口 "MIRAI_PORT": 7827, + # Mirai API HTTP Key + "MIRAI_KEY": "StarBot", # 登录 B 站账号所需 Cookie 数据 ( 不登录账号将有部分功能不可用 ) 各字段获取方式查看:https://bot.starlwr.com/depoly/document "SESSDATA": None,