From 0e74aed8aa9057c26fc4e9795a483e9184079dfa Mon Sep 17 00:00:00 2001 From: xuqian13 <1334431750@qq.com> Date: Tue, 1 Jul 2025 12:54:34 +0800 Subject: [PATCH] Update src/send_handler.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- src/send_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/send_handler.py b/src/send_handler.py index b30fbce..53b63d0 100644 --- a/src/send_handler.py +++ b/src/send_handler.py @@ -350,6 +350,11 @@ class SendHandler: 处理AI语音发送命令的逻辑。 并返回 NapCat 兼容的 (action, params) 元组。 """ + if not group_info or not group_info.group_id: + raise ValueError("AI语音发送命令必须在群聊上下文中使用") + if not args: + raise ValueError("AI语音发送命令缺少参数") + group_id: int = int(group_info.group_id) character_id = args.get("character") text_content = args.get("text")