From 0638f3f29de565afd26bdb0008c3b67074a61518 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Thu, 1 Feb 2024 15:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BB=85=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=82=B9=E6=AD=8C=E5=91=BD=E4=BB=A4=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E4=BC=98=E5=8C=96=E5=91=BD=E4=BB=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/my_handle.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/my_handle.py b/utils/my_handle.py index c14c60cd..6389d42c 100644 --- a/utils/my_handle.py +++ b/utils/my_handle.py @@ -722,6 +722,22 @@ def choose_song_handle(self, data): # 去除命令前缀 content = content[len(start_cmd):] + + # 说明用户仅发送命令,没有发送歌名,说明用户不会用 + if content == "": + message = { + "type": "comment", + "tts_type": My_handle.config.get("audio_synthesis_type"), + "data": My_handle.config.get(My_handle.config.get("audio_synthesis_type")), + "config": My_handle.config.get("filter"), + "user_name": user_name, + "content": f'点歌命令错误,命令为 {My_handle.config.get("choose_song", "start_cmd")}+歌名' + } + + self.audio_synthesis_handle(message) + + return True + # 判断是否有此歌曲 song_filename = My_handle.common.find_best_match(content, choose_song_song_lists, similarity=My_handle.config.get("choose_song", "similarity")) if song_filename is None: