refactor(napcat): 在语音消息处理程序中移除未使用的 TTS 检查

`handle_voice_message` 方法中对 `voice.use_tts` 配置的检查已被移除,因为它是多余的。将消息编码为语音的决定在上游处理,因此在此阶段无需此检查。此外,添加了日志警告以处理接收到空语音消息的情况。
This commit is contained in:
tt-P607
2025-11-28 08:24:02 +08:00
parent 655e535d96
commit 883e391010

View File

@@ -370,14 +370,8 @@ class SendHandler:
def handle_voice_message(self, encoded_voice: str) -> dict:
"""处理语音消息"""
use_tts = False
if self.plugin_config:
use_tts = config_api.get_plugin_config(self.plugin_config, "voice.use_tts", False)
if not use_tts:
logger.warning("未启用语音消息处理")
return {}
if not encoded_voice:
logger.warning("接收到空的语音消息,跳过处理")
return {}
return {
"type": "record",