jesus is within my soul
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 37s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 37s
This commit is contained in:
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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user