From 3550103e45832ee6b158f25537db0bead7c27197 Mon Sep 17 00:00:00 2001 From: a490077 <32692385+a490077@users.noreply.github.com> Date: Sun, 19 Oct 2025 20:09:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20QQ=20=E5=AE=98=E6=96=B9=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E5=A2=9E=E5=8A=A0=E6=B2=99=E7=9B=92=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=80=89=E9=A1=B9=EF=BC=8C=E8=AE=A9=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=83=BD=E8=B7=B3=E8=BF=87=20IP=20=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95=E9=AA=8C=E8=AF=81=20(#3087)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * QQ官方机器人增加沙箱模式选项,让本地部署能跳过IP白名单验证 * chore: ruff format --------- Co-authored-by: 郭鹏 Co-authored-by: Soulter <905617992@qq.com> --- astrbot/core/config/default.py | 1 + .../platform/sources/qqofficial_webhook/qo_webhook_server.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index b160b3008..a4743ba9e 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -162,6 +162,7 @@ CONFIG_METADATA_2 = { "enable": False, "appid": "", "secret": "", + "is_sandbox": False, "callback_server_host": "0.0.0.0", "port": 6196, }, diff --git a/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py b/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py index bc1e4b170..4a2eae747 100644 --- a/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py +++ b/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py @@ -15,12 +15,13 @@ class QQOfficialWebhook: self.appid = config["appid"] self.secret = config["secret"] self.port = config.get("port", 6196) + self.is_sandbox = config.get("is_sandbox", False) self.callback_server_host = config.get("callback_server_host", "0.0.0.0") if isinstance(self.port, str): self.port = int(self.port) - self.http: BotHttp = BotHttp(timeout=300) + self.http: BotHttp = BotHttp(timeout=300, is_sandbox=self.is_sandbox) self.api: BotAPI = BotAPI(http=self.http) self.token = Token(self.appid, self.secret)