1
0
Fork 0

add disable command executing because yes

might be useful later
This commit is contained in:
Chayapak 2023-06-04 10:45:35 +07:00
parent 9d94a6b1e4
commit e305cec555

View file

@ -6,6 +6,7 @@ import land.chipmunk.chayapak.chomens_bot.command.CommandContext;
import land.chipmunk.chayapak.chomens_bot.commands.*; import land.chipmunk.chayapak.chomens_bot.commands.*;
import land.chipmunk.chayapak.chomens_bot.util.ExceptionUtilities; import land.chipmunk.chayapak.chomens_bot.util.ExceptionUtilities;
import lombok.Getter; import lombok.Getter;
import lombok.Setter;
import net.dv8tion.jda.api.entities.Role; import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
@ -21,6 +22,8 @@ public class CommandHandlerPlugin {
@Getter private final List<Command> commands = new ArrayList<>(); @Getter private final List<Command> commands = new ArrayList<>();
@Getter @Setter private boolean disabled = false;
public CommandHandlerPlugin (Bot bot) { public CommandHandlerPlugin (Bot bot) {
this.bot = bot; this.bot = bot;
@ -77,6 +80,8 @@ public class CommandHandlerPlugin {
boolean console, boolean console,
MessageReceivedEvent event MessageReceivedEvent event
) { ) {
if (disabled) return null;
final String[] splitInput = input.trim().split("\\s+"); final String[] splitInput = input.trim().split("\\s+");
final String commandName = splitInput[0]; final String commandName = splitInput[0];