package cn.chengzhiya.helloworld.command;
import cn.chengzhiya.mhdfbot.api.command.CommandExecutor;
import cn.chengzhiya.helloworld.Main;
public final class HelloWorld implements CommandExecutor {
@Override
public void onCommand(String command, String[] args) {
Main.instance.getLogger().info("hello World!");
}
}
package cn.chengzhiya.helloworld.command;
import cn.chengzhiya.mhdfbot.api.command.TabExecutor;
import cn.chengzhiya.helloworld.Main;
public final class HelloWorld implements TabExecutor{
@Override
public void onCommand(String command, String[] args) {
Main.instance.getLogger().info("hello World!");
}
@Override
public List<String> onTabComplete(String command, String[] args) {
return List.of("欸, 这都被你发现了, 你好聪明噢!");
}
}
registerCommand(
new Command("helloworld")
.executor(new HelloWorld()) // 命令实例
.tabCompleter(new HelloWoorld()) // 命令补全实例(可选)
.description("打印 hello World!") // 简介(可选)
.usage("helloworld") // 用法(可选)
);