forked from Fascinated/Bat
jesus is within my soul
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