public static boolean matchUserStatus(String id,User user){
  if (id.equals("$mod")) {
    if (user.isModerator()) {
      return true;
    }
  }
 else   if (id.equals("$sub")) {
    if (user.isSubscriber()) {
      return true;
    }
  }
 else   if (id.equals("$turbo")) {
    if (user.hasTurbo()) {
      return true;
    }
  }
 else   if (id.equals("$admin")) {
    if (user.isAdmin()) {
      return true;
    }
  }
 else   if (id.equals("$broadcaster")) {
    if (user.isBroadcaster()) {
      return true;
    }
  }
 else   if (id.equals("$staff")) {
    if (user.isStaff()) {
      return true;
    }
  }
 else   if (id.equals("$bot")) {
    if (user.isBot()) {
      return true;
    }
  }
 else   if (id.equals("$globalmod")) {
    if (user.isGlobalMod()) {
      return true;
    }
  }
 else   if (id.equals("$anymod")) {
    if (user.isAdmin() || user.isBroadcaster() || user.isGlobalMod()|| user.isModerator()|| user.isStaff()) {
      return true;
    }
  }
  return false;
}

public static boolean matchUserStatus ( String id , User user ) { if ( id . equals ( "$mod" ) ) { if ( user . isModerator ( ) ) { return true ; } } else if ( id . equals ( "$sub" ) ) { if ( user . isSubscriber ( ) ) { return true ; } } else if ( id . equals ( "$turbo" ) ) { if ( user . hasTurbo ( ) ) { return true ; } } else if ( id . equals ( "$admin" ) ) { if ( user . isAdmin ( ) ) { return true ; } } else if ( id . equals ( "$broadcaster" ) ) { if ( user . isBroadcaster ( ) ) { return true ; } } else if ( id . equals ( "$staff" ) ) { if ( user . isStaff ( ) ) { return true ; } } else if ( id . equals ( "$bot" ) ) { if ( user . isBot ( ) ) { return true ; } } else if ( id . equals ( "$globalmod" ) ) { if ( user . isGlobalMod ( ) ) { return true ; } } else if ( id . equals ( "$anymod" ) ) { if ( user . isAdmin ( ) || user . isBroadcaster ( ) || user . isGlobalMod ( ) || user . isModerator ( ) || user . isStaff ( ) ) { return true ; } } return false ; }
checks if the id matches the given user . the id can be one of : $ mod , $ sub , $ turbo , $ admin , $ broadcaster , $ staff , $ bot . if the user has the appropriate user status , this returns true . if the id is unknown or the user doesn ' t have the required status , this returns false .
