mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-08 18:54:44 +00:00
Merge branch 'main' of https://github.com/Coloryr/AllMusic
This commit is contained in:
commit
f88ca5823c
3 files changed
+23
-2
No files matched your search
@@ -127,7 +127,7 @@ AllMusic不会内置音乐api,你想要正常使用需要自己安装
|
||||
- /music mute 不再参与点歌,再输入一次恢复
|
||||
- /music mute list 不接收空闲列表点歌,再输入一次恢复
|
||||
- /music search [歌名] 搜索歌曲
|
||||
- /music search [音乐API] [歌名] 搜索歌曲
|
||||
- /music searchapi [音乐API] [歌名] 搜索歌曲
|
||||
- /music select [序列] 选择歌曲
|
||||
- /music nextpage 切换下一页歌曲搜索结果
|
||||
- /music lastpage 切换上一页歌曲搜索结果
|
||||
|
||||
@@ -21,6 +21,11 @@ public class CommandSearch extends ACommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length < 2) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().search.emptySearch);
|
||||
return;
|
||||
}
|
||||
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().search.startSearch);
|
||||
CommandEX.searchMusic(sender, name, args, false);
|
||||
}
|
||||
|
||||
+17
-1
@@ -5,6 +5,10 @@ import com.coloryr.allmusic.server.core.command.ACommand;
|
||||
import com.coloryr.allmusic.server.core.command.CommandEX;
|
||||
import com.coloryr.allmusic.server.core.command.PermissionList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandSearchApi extends ACommand {
|
||||
@Override
|
||||
public void execute(Object sender, String name, String[] args) {
|
||||
@@ -23,10 +27,14 @@ public class CommandSearchApi extends ACommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length < 3) {
|
||||
if (args.length < 2) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().musicPlay.error2);
|
||||
return;
|
||||
}
|
||||
if (args.length < 3) {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().search.emptySearch);
|
||||
return;
|
||||
}
|
||||
|
||||
String[] newArgs = new String[args.length - 1];
|
||||
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
|
||||
@@ -34,4 +42,12 @@ public class CommandSearchApi extends ACommand {
|
||||
AllMusic.side.sendMessage(sender, AllMusic.getMessage().search.startSearch);
|
||||
CommandEX.searchMusicApi(sender, name, newArgs, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> tab(Object player, String name, String[] args, int index) {
|
||||
if (index == 1 && args.length <= index + 1) {
|
||||
return new ArrayList<>(AllMusic.MUSIC_APIS.keySet());
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user