From 36414c4b00077fdf479eecbc900f67bc1fbdf3c7 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 5 Feb 2025 00:02:18 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96aiocqhttp=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=99=A8=E5=AF=B9=E7=94=A8=E6=88=B7=E9=9D=9E=E6=B3=95?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/config/default.py | 2 +- .../platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 2bd095153..c2e807137 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -109,7 +109,7 @@ CONFIG_METADATA_2 = { "id": "default", "type": "aiocqhttp", "enable": False, - "ws_reverse_host": "", + "ws_reverse_host": "0.0.0.0", "ws_reverse_port": 6199, }, "gewechat(微信)": { diff --git a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py index 862edb25b..6c92d919d 100644 --- a/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +++ b/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py @@ -122,7 +122,10 @@ class AiocqhttpAdapter(Platform): def run(self) -> Awaitable[Any]: if not self.host or not self.port: - return + logger.warning("aiocqhttp: 未配置 ws_reverse_host 或 ws_reverse_port,将使用默认值:http://0.0.0.0:6199") + self.host = "0.0.0.0" + self.port = 6199 + self.bot = CQHttp(use_ws_reverse=True, import_name='aiocqhttp', api_timeout_sec=180) @self.bot.on_message('group') async def group(event: Event):