如题,
经过测试,安装了LuckPerms插件的mirai,在测试command时会出现命令重复调用问题,在本地无LuckPerms插件的bot则可以正常使用command命令,不会出现重复调用问题。
本地:
a49c4406-0607-40a2-9a79-0e621bc575ad-image.png
安装了插件的服务器:
9c4225c4-42de-425b-8215-a629ef74e775-image.png
请教该问题出现的原因以及解决方式?
另附代码段:
onEnable :
CommandManager.INSTANCE.registerCommand(Mycommand.INSTANCE, false);
myCommand:
public class Mycommand extends JSimpleCommand {
public static final Mycommand INSTANCE = new Mycommand();
private Mycommand(){
super(Plugin.INSTANCE, "test", new String[]{"s"}, Plugin.INSTANCE.getParentPermission());
setDescription("这是一个测试command");
}
@Handler
public void onCommand(CommandSender sender, String mes){
sender.sendMessage("test");
}
}
EventHandler :
FriendCommandSenderOnMessage to = new FriendCommandSenderOnMessage(event);
CommandManager.INSTANCE.executeCommand(to, event.getMessage(),false);
MemberCommandSenderOnMessage to = new MemberCommandSenderOnMessage(event);
CommandManager.INSTANCE.executeCommand(to, event.getMessage(),false);
以下测试基于本地没有LuckPerms插件的环境:
尽管我知道我似乎不应该在EventHandler中再次监听命令,但是不监听他就是不响应……去掉好友监听好友不响应,去掉群监听群不响应??