mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-08 18:54:44 +00:00
2 files changed
+12
-4
No files matched your search
@@ -75,12 +75,20 @@ public class CommandEX {
|
||||
* @param isDefault 是否是默认点歌方式
|
||||
*/
|
||||
public static void searchMusic(Object sender, String name, String[] args, boolean isDefault) {
|
||||
|
||||
String apiname = AllMusic.getConfig().defaultApi;
|
||||
|
||||
if (!AllMusic.MUSIC_APIS.containsKey(apiname)) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().musicPlay.error2);
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerAddMusicObj obj = new PlayerAddMusicObj();
|
||||
obj.sender = sender;
|
||||
obj.name = name;
|
||||
obj.args = args;
|
||||
obj.isDefault = isDefault;
|
||||
obj.api = AllMusic.getConfig().defaultApi;
|
||||
obj.api = apiname;
|
||||
|
||||
if (AllMusic.side.onMusicAdd(sender, obj)) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().addMusic.cancel);
|
||||
@@ -106,8 +114,8 @@ public class CommandEX {
|
||||
|
||||
String apiname = args[0];
|
||||
|
||||
if (!AllMusic.MUSIC_APIS.containsKey(apiName)) {
|
||||
AllMusic.side.sendMessage(sender, "不存在的音乐源:" + apiName);
|
||||
if (!AllMusic.MUSIC_APIS.containsKey(apiname)) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().musicPlay.error2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class MusicSearch {
|
||||
IMusicApi api = AllMusic.MUSIC_APIS.get(obj.api);
|
||||
if (api == null) {
|
||||
AllMusic.side.sendMessageTask(obj.sender, AllMusic.getMessage().musicPlay.error2);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
SearchPageObj search = api.search(obj.args, obj.isDefault);
|
||||
if (search == null)
|
||||
|
||||
Reference in new issue
Block a user