2024-04-19 09:46:54 +08:00
|
|
|
package com.coloryr.allmusic.server.core.command;
|
2023-10-22 10:14:55 +08:00
|
|
|
|
2024-04-19 09:46:54 +08:00
|
|
|
import com.coloryr.allmusic.server.core.AllMusic;
|
|
|
|
|
import com.coloryr.allmusic.server.core.utils.Function;
|
2023-10-22 10:14:55 +08:00
|
|
|
|
2024-04-17 22:15:12 +08:00
|
|
|
public class CommandAddList extends ACommand {
|
2023-10-22 10:14:55 +08:00
|
|
|
@Override
|
|
|
|
|
public void ex(Object sender, String name, String[] args) {
|
|
|
|
|
if (args.length != 2) {
|
2024-04-17 22:15:12 +08:00
|
|
|
AllMusic.side.sendMessage(sender, AllMusic.getMessage().command.error);
|
2023-10-22 10:14:55 +08:00
|
|
|
return;
|
|
|
|
|
}
|
2024-05-13 09:33:41 +08:00
|
|
|
|
|
|
|
|
String musicID;
|
|
|
|
|
|
|
|
|
|
if (args[1].contains("id=") && !args[1].contains("/?userid")) {
|
|
|
|
|
if (args[1].contains("&user"))
|
|
|
|
|
musicID = Function.getString(args[1], "id=", "&user");
|
|
|
|
|
else
|
|
|
|
|
musicID = Function.getString(args[1], "id=", null);
|
|
|
|
|
} else
|
|
|
|
|
musicID = args[1];
|
|
|
|
|
|
|
|
|
|
if (Function.isInteger(musicID)) {
|
|
|
|
|
AllMusic.getMusicApi().setList(musicID, sender);
|
|
|
|
|
AllMusic.side.sendMessage(sender, "§d[AllMusic3]§2添加空闲音乐列表" + musicID);
|
2023-10-22 10:14:55 +08:00
|
|
|
} else {
|
2024-04-17 22:15:12 +08:00
|
|
|
AllMusic.side.sendMessage(sender, "§d[AllMusic3]§2请输入有效的音乐列表ID");
|
2023-10-22 10:14:55 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|