From 33ff4686f3f5bffe50450739d73c802c27fe9527 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 26 Jun 2024 00:34:13 +0100 Subject: [PATCH] jesus is within my soul --- .../java/cc/fascinated/bat/service/CommandService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/service/CommandService.java b/src/main/java/cc/fascinated/bat/service/CommandService.java index 439ef44..4f12e5f 100644 --- a/src/main/java/cc/fascinated/bat/service/CommandService.java +++ b/src/main/java/cc/fascinated/bat/service/CommandService.java @@ -90,7 +90,7 @@ public class CommandService extends ListenerAdapter { @Override public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) { Guild discordGuild = event.getGuild(); - if (discordGuild == null || event.getUser().isBot() || event.getMember() == null) { + if (event.getUser().isBot() || event.getMember() == null) { return; } @@ -99,9 +99,7 @@ public class CommandService extends ListenerAdapter { if (command == null) { return; } - - boolean ranInGuild = event.isFromGuild(); - BatGuild guild = ranInGuild ? guildService.getGuild(discordGuild.getId()) : null; + BatGuild guild = discordGuild != null ? guildService.getGuild(discordGuild.getId()) : null; BatUser user = userService.getUser(event.getUser().getId()); try { @@ -132,7 +130,7 @@ public class CommandService extends ListenerAdapter { } // Check if the user has the required permissions - if (ranInGuild) { + if (discordGuild != null) { List missingPermissions = new ArrayList<>(); for (Permission permission : requiredPermissions) { if (!event.getMember().hasPermission(permission)) {