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
|
@Override
|
||||||
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
|
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
|
||||||
Guild discordGuild = event.getGuild();
|
Guild discordGuild = event.getGuild();
|
||||||
if (discordGuild == null || event.getUser().isBot() || event.getMember() == null) {
|
if (event.getUser().isBot() || event.getMember() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,9 +99,7 @@ public class CommandService extends ListenerAdapter {
|
|||||||
if (command == null) {
|
if (command == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
BatGuild guild = discordGuild != null ? guildService.getGuild(discordGuild.getId()) : null;
|
||||||
boolean ranInGuild = event.isFromGuild();
|
|
||||||
BatGuild guild = ranInGuild ? guildService.getGuild(discordGuild.getId()) : null;
|
|
||||||
BatUser user = userService.getUser(event.getUser().getId());
|
BatUser user = userService.getUser(event.getUser().getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -132,7 +130,7 @@ public class CommandService extends ListenerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if the user has the required permissions
|
// Check if the user has the required permissions
|
||||||
if (ranInGuild) {
|
if (discordGuild != null) {
|
||||||
List<Permission> missingPermissions = new ArrayList<>();
|
List<Permission> missingPermissions = new ArrayList<>();
|
||||||
for (Permission permission : requiredPermissions) {
|
for (Permission permission : requiredPermissions) {
|
||||||
if (!event.getMember().hasPermission(permission)) {
|
if (!event.getMember().hasPermission(permission)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user