Skip to content
Advertisement

Check if user is banned or not

I cant seem to figure out how to check if a user is already banned if tried this event.getGuild().retrieveBan(event.getUser() but you cant use an if statement with it

Advertisement

Answer

You should use the failure and success callbacks:

guild.retrieveBan(user).queue(
  (success) -> {
    // the user is banned
  }, 
  (failure) -> {
    // the user is not banned
  }
);
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement