Bugfixing

This commit is contained in:
Steven Tracey 2022-08-18 14:10:50 -04:00
parent 68194b3879
commit 7a485e9869
3 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,7 @@ plugins {
mainClassName = 'tech.nevets.modbot.CoreBot'
group 'tech.nevets'
version '1.0.0'
version '1.0.1'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

View File

@ -35,7 +35,6 @@ public class CoreBot {
.addEventListeners(coreListener);
for (ListenerAdapter listener : PLUGIN_LISTENERS) {
LOGGER.error("Loaded Plugin listener");
builder.addEventListeners(listener);
}

View File

@ -60,6 +60,7 @@ public class CommandRegistry {
return cmd;
}
}
LOGGER.warn("Returned null for command search: " + searchLower);
return null;
}
@ -118,19 +119,18 @@ public class CommandRegistry {
IPrefixCommand cmd = getPrefixCommand(invoke);
assert event.getMember() != null;
assert cmd != null;
if (!hasPermission(event.getMember(), cmd)) {
event.getMessage().reply("You do not have permission to use this command.").queue();
return;
}
if (cmd != null) {
event.getChannel().sendTyping().queue();
List<String> args = Arrays.asList(split).subList(1, split.length);
CommandContext ctx = new CommandContext(event, args);
cmd.handle(ctx);
}
}
public void handle(SlashCommandEvent event) {