public static void checkPermissions(IUser user,IGuild guild,EnumSet<Permissions> required) throws MissingPermissionsException {
  try {
    EnumSet<Permissions> contained=EnumSet.noneOf(Permissions.class);
    List<IRole> roles=user.getRolesForGuild(guild);
    for (    IRole role : roles) {
      contained.addAll(role.getPermissions());
    }
    checkPermissions(contained,required);
  }
 catch (  UnsupportedOperationException e) {
  }
}

public static void checkPermissions ( IUser user , IGuild guild , EnumSet < Permissions > required ) throws MissingPermissionsException { try { EnumSet < Permissions > contained = EnumSet . noneOf ( Permissions . class ) ; List < IRole > roles = user . getRolesForGuild ( guild ) ; for ( IRole role : roles ) { contained . addAll ( role . getPermissions ( ) ) ; } checkPermissions ( contained , required ) ; } catch ( UnsupportedOperationException e ) { } }
checks a set of permissions provided by a guild against required permissions .
