/** * Builds a role with the configuration specified by the builder. * * @return A role with the configuration specified by the builder. */ public IRole build() { if (guild == null) throw new RuntimeException("A guild must be set to create a role."); Role role = (Role) guild.createRole(); role.edit(color != null ? color : role.getColor(), hoist, name != null ? name : role.getName(), permissions != null ? permissions : role.getPermissions(), mentionable); return role; } }