Skip to content

Commit 89bb944

Browse files
authored
Update SlashCommandHandler.java to actually cancel the command when executor doesn't have permission
1 parent 7965621 commit 89bb944

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/uk/co/nyvil/bot/commands/manager/SlashCommandHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public void onSlashCommandInteraction(SlashCommandInteractionEvent e) {
2323

2424
if(command.get().neededPermission() != null && !e.getMember().hasPermission(command.get().neededPermission())) {
2525
e.replyEmbeds(MessageUtils.createErrorEmbed("You don't have the permission to execute this command!").build()).setEphemeral(true).queue();
26+
return;
2627
}
2728

2829
SlashCommandRecord record = new SlashCommandRecord(command.get(), e, e.getMember(), e.getChannel().asTextChannel(), e.getOptions());

0 commit comments

Comments
 (0)