Update src/send_handler.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
pull/45/head
xuqian13 2025-07-01 12:54:34 +08:00 committed by GitHub
parent c56b24d613
commit 0e74aed8aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -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")