Revert quick fix
This commit is contained in:
parent
d088e2bf95
commit
3af151d89a
@ -1,10 +1,7 @@
|
||||
package cc.fascinated.bat.service;
|
||||
|
||||
import cc.fascinated.bat.Consts;
|
||||
import cc.fascinated.bat.command.BatCommand;
|
||||
import cc.fascinated.bat.command.BatCommandExecutor;
|
||||
import cc.fascinated.bat.command.BatSubCommand;
|
||||
import cc.fascinated.bat.command.Category;
|
||||
import cc.fascinated.bat.command.*;
|
||||
import cc.fascinated.bat.common.EmbedUtils;
|
||||
import cc.fascinated.bat.model.BatGuild;
|
||||
import cc.fascinated.bat.model.BatUser;
|
||||
@ -78,10 +75,10 @@ public class CommandService extends ListenerAdapter {
|
||||
|
||||
// Unregister all commands that Discord has but we don't
|
||||
jda.retrieveCommands().complete().forEach(command -> {
|
||||
BatCommand batCommand = commands.get(command.getName());
|
||||
if (batCommand == null) {
|
||||
CommandInfo commandInfo = commands.get(command.getName()).getCommandInfo();
|
||||
if (commands.containsKey(command.getName()) && (commandInfo.category().isHidden() || commandInfo.botOwnerOnly())) {
|
||||
jda.deleteCommandById(command.getId()).complete(); // Unregister the command on Discord
|
||||
log.info("Unregistered unknown command \"{}\" from Discord", command.getName());
|
||||
log.info("Unregistered hidden command \"{}\" from Discord", command.getName());
|
||||
return;
|
||||
}
|
||||
if (commands.containsKey(command.getName())) {
|
||||
@ -211,4 +208,4 @@ public class CommandService extends ListenerAdapter {
|
||||
.queue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user