Skip to content

Commit

Permalink
用户仅发送点歌命令的情况下,优化命令错误的提示语
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Feb 1, 2024
1 parent 838c016 commit 0638f3f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions utils/my_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0638f3f

Please sign in to comment.