优化配置项。
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
[Music]
|
||||
enable = true
|
||||
command = ["点歌", "音乐", "音乐点播", "点播音乐", "音乐点歌"]
|
||||
command-format = """
|
||||
🎵点歌指令:
|
||||
点歌 歌曲名
|
||||
"""
|
||||
"""
|
||||
|
||||
music_api_url ="https://www.hhlqilongzhu.cn/api/joox/juhe_music.php?msg={song_name}&type=json&n=1"
|
||||
@@ -57,7 +57,7 @@ class MusicPlugin(MessagePluginInterface):
|
||||
self._commands = self._config.get("Music", {}).get("command", ["点歌", "音乐"])
|
||||
self.command_format = self._config.get("Music", {}).get("command-format", "点歌 歌曲名")
|
||||
self.enable = self._config.get("Music", {}).get("enable", True)
|
||||
|
||||
self.music_api_url = self._config.get("Music", {}).get("music_api_url", "")
|
||||
self.LOG.info(f"[{self.name}] 插件初始化完成,指令:{self._commands}")
|
||||
return True
|
||||
|
||||
@@ -127,7 +127,7 @@ class MusicPlugin(MessagePluginInterface):
|
||||
"""搜索歌曲信息"""
|
||||
try:
|
||||
# 尝试QQ音乐API
|
||||
fallback_api = f"https://www.hhlqilongzhu.cn/api/joox/juhe_music.php?msg={song_name}&type=json&n=1"
|
||||
fallback_api = f"{self.music_api_url}".format(song_name=song_name)
|
||||
response = requests.get(fallback_api)
|
||||
|
||||
if response.status_code != 200:
|
||||
|
||||
Reference in New Issue
Block a user