This repository has been archived by the owner on Feb 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
消息接受类增加event.isCommand()判断是否指令 #40
Labels
Comments
因为指令系统也是基于消息事件实现的啦w |
谢谢了!!! |
刚才发错了, 刚才那个 this 是 CommandManager 啦w final boolean isGM = event instanceof EventGroupMessage;
final boolean isDM = event instanceof EventDiscussMessage;
final boolean isPM = event instanceof EventPrivateMessage;
try
{
CommandArgsParser.parse(event.getBot().getCommandManager(), event.getMessage(), isDM || isGM);
}
catch (NotACommandException | CommandNotFoundException e)
{
// 不是指令
return;
} |
谢谢 |
希望下一个版本这个能变成一个method |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
使用指令的同时也算一条消息,没有东西判断这条消息是否为指令。
希望增加 method .isCommand(); return boolen;用来判断该消息是否为指令。
或者直接舍弃,如果是指令只触发指令的listener不触发消息的listener。
The text was updated successfully, but these errors were encountered: