From bdcd876663a6f30882c745b5a25f1ea81dcdc4a9 Mon Sep 17 00:00:00 2001 From: SXP-Simon Date: Sun, 8 Feb 2026 19:54:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=8B=E5=8A=A8=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=EF=BC=8C=E7=BC=96=E6=8E=92=E5=99=A8=E9=A6=96=E5=85=88=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E4=BB=8E=20event=20=E7=9B=B4=E6=8E=A5=E6=8F=90?= =?UTF-8?q?=E5=8F=96=20bot=20=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 24f8638..4f77228 100644 --- a/main.py +++ b/main.py @@ -254,7 +254,16 @@ class QQGroupDailyAnalysis(Star): try: # 4. 获取编排器 - orchestrator = self._get_orchestrator(platform_id, platform_name) + # 首先尝试从 event 直接提取 bot 客户端 + bot_from_event = None + if hasattr(event, "client"): # Discord 平台有 client 属性 + bot_from_event = event.client + elif hasattr(event, "bot"): # 其他平台可能有 bot 属性 + bot_from_event = event.bot + + orchestrator = self._get_orchestrator( + platform_id, platform_name, bot_from_event + ) if not orchestrator: # 尝试使用 bot_manager 获取 bot 实例再创建 bot_instance = self.bot_manager.get_bot_instance(platform_id)