Check if user is banned or not

Tags: ,

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


You should use the failure and success callbacks:

  (success) -> {
    // the user is banned
  (failure) -> {
    // the user is not banned

Source: stackoverflow