修复歌曲名中包括“/”的歌无法发送的问题

This commit is contained in:
ClovertaTheTrilobita 2025-02-05 23:20:18 +08:00
parent 8a04385e3f
commit b3650a6ed7
2 changed files with 1 additions and 5 deletions

View file

@ -48,7 +48,7 @@ async def handle_function(msg: MessageEvent):
#搜索歌曲
song_id,song_name,singer,song_url = netease_music_search(keyword,session)
song_name = str(song_name).replace(".", "·")
song_name = str(song_name).replace(".", "·").replace("/", "")
if song_id is None:
await music.finish("\n没有找到歌曲或检索到的歌曲均为付费喔qwq\n这绝对不是我的错,绝对不是!")
else:

View file

@ -1,11 +1,7 @@
import nonebot
from nonebot import Bot
from nonebot.rule import to_me
from nonebot.plugin import on_command
from nonebot.adapters import Message
from nonebot.params import CommandArg
from nonebot.adapters.qq import MessageEvent
import datetime
weather = on_command("天气", rule=to_me(), aliases={"weather", "查天气"}, priority=10, block=True)