jesus is within my soul

This commit is contained in:
Lee 2024-06-26 00:34:13 +01:00
parent ac760f84be
commit 33ff4686f3

@ -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<Permission> missingPermissions = new ArrayList<>();
for (Permission permission : requiredPermissions) {
if (!event.getMember().hasPermission(permission)) {