forked from ChomeNS/chomens-bot-java
add disable command executing because yes
might be useful later
This commit is contained in:
parent
9d94a6b1e4
commit
e305cec555
1 changed files with 5 additions and 0 deletions
|
@ -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.util.ExceptionUtilities;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
@ -21,6 +22,8 @@ public class CommandHandlerPlugin {
|
|||
|
||||
@Getter private final List<Command> commands = new ArrayList<>();
|
||||
|
||||
@Getter @Setter private boolean disabled = false;
|
||||
|
||||
public CommandHandlerPlugin (Bot bot) {
|
||||
this.bot = bot;
|
||||
|
||||
|
@ -77,6 +80,8 @@ public class CommandHandlerPlugin {
|
|||
boolean console,
|
||||
MessageReceivedEvent event
|
||||
) {
|
||||
if (disabled) return null;
|
||||
|
||||
final String[] splitInput = input.trim().split("\\s+");
|
||||
|
||||
final String commandName = splitInput[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue