feat: Custom mirai host support

This commit is contained in:
LWR
2023-06-20 01:18:06 +08:00
parent f712c278d4
commit a48265b24e
2 changed files with 5 additions and 3 deletions

View File

@@ -53,8 +53,8 @@ class Bot(BaseModel):
connection=AriadneConfig(
self.qq,
"StarBot",
HttpClientConfig(host=f"http://localhost:{config.get('MIRAI_PORT')}"),
WebsocketClientConfig(host=f"http://localhost:{config.get('MIRAI_PORT')}"),
HttpClientConfig(host=f"http://{config.get('MIRAI_HOST')}:{config.get('MIRAI_PORT')}"),
WebsocketClientConfig(host=f"http://{config.get('MIRAI_HOST')}:{config.get('MIRAI_PORT')}"),
),
log_config=LogConfig(log_level="DEBUG")
)

View File

@@ -33,7 +33,9 @@ DEFAULT_CONFIG = {
# MySQL 数据库名
"MYSQL_DB": "starbot",
# Mirai HTTP 及 Websocket 端口
# Mirai API HTTP 及 Websocket 地址
"MIRAI_HOST": "localhost",
# Mirai API HTTP 及 Websocket 端口
"MIRAI_PORT": 7827,
# 登录 B 站账号所需 Cookie 数据 ( 不登录账号将有部分功能不可用 ) 各字段获取方式查看https://bot.starlwr.com/depoly/document