/// Get the ID of the verified role on the RCOS discord if it exists.
Get the ID of the verified role on the RCOS discord if it exists.
Get the ID of the verified role on the RCOS discord if it exists .
pub async fn rcos_discord_verified_role_id() -> Result<Option<RoleId>, TelescopeError> {
    // Get the RCOS Guild ID.
    let rcos_discord: u64 = global_config().discord_config.rcos_guild_id();
    // Get role
    Ok(global_discord_client()
        .get_guild_roles(rcos_discord)
        .await
        .map_err(|err| {
            error!("Could not get RCOS Discord Roles. Internal error: {}", err);
            TelescopeError::serenity_error(err)
        })?
        .iter()
        // We use a simple string comparison for now. We can change this to use
        // something else later on if needed.
        .find(|role| role.name.eq_ignore_ascii_case("Verified"))
        // Extract the ID from the Discord Role.
        .map(|role| role.id))
}
pub async fn rcos_discord_verified_role_id ( ) -> Result < Option < RoleId > , TelescopeError > { // Get the RCOS Guild ID. let rcos_discord : u64 = global_config ( ) . discord_config . rcos_guild_id ( ) ; // Get role Ok ( global_discord_client ( ) . get_guild_roles ( rcos_discord ) . await . map_err ( | err | { error ! ( " " err ) ; TelescopeError :: serenity_error ( err ) } ) ? . iter ( ) // We use a simple string comparison for now. We can change this to use // something else later on if needed. . find ( | role | role . name . eq_ignore_ascii_case ( " " ) ) // Extract the ID from the Discord Role. . map ( | role | role . id ) ) }
Get the ID of the verified role on the RCOS discord if it exists.
Get the ID of the verified role on the RCOS discord if it exists .