CachedGuild

Struct CachedGuild 

Source
pub struct CachedGuild { /* private fields */ }
Expand description

Represents a cached Guild.

Implementations§

Source§

impl CachedGuild

Source

pub const fn afk_channel_id(&self) -> Option<Id<ChannelMarker>>

ID of the AFK channel.

Source

pub const fn afk_timeout(&self) -> AfkTimeout

AFK timeout in seconds.

Source

pub const fn application_id(&self) -> Option<Id<ApplicationMarker>>

For bot created guilds, the ID of the creating application.

Source

pub const fn banner(&self) -> Option<&ImageHash>

Source

pub const fn default_message_notifications( &self, ) -> DefaultMessageNotificationLevel

Default message notification level.

Source

pub fn description(&self) -> Option<&str>

For Community guilds, the description.

Source

pub const fn discovery_splash(&self) -> Option<&ImageHash>

For discoverable guilds, the discovery splash hash.

See Discord Docs/Image Formatting.

Source

pub const fn explicit_content_filter(&self) -> ExplicitContentFilter

Explicit content filter level.

Source

pub fn features(&self) -> Features<'_>

Enabled guild features.

Source

pub fn guild_scheduled_events(&self) -> &[GuildScheduledEvent]

Scheduled guild events.

Source

pub const fn icon(&self) -> Option<&ImageHash>

Source

pub const fn id(&self) -> Id<GuildMarker>

ID of the guild.

Source

pub const fn joined_at(&self) -> Option<Timestamp>

[Timestamp] of the user’s join date.

Source

pub const fn large(&self) -> bool

Whether this guild is “large”.

Source

pub const fn max_members(&self) -> Option<u64>

Maximum members.

Source

pub const fn max_presences(&self) -> Option<u64>

Maximum presences.

Source

pub const fn max_stage_video_channel_users(&self) -> Option<u64>

Maximum number of users in a stage video channel.

Source

pub const fn max_video_channel_users(&self) -> Option<u64>

Maximum number of users in a video channel.

Source

pub const fn member_count(&self) -> Option<u64>

Total number of members in the guild.

Source

pub const fn mfa_level(&self) -> MfaLevel

Required MFA level.

Source

pub fn name(&self) -> &str

Name of the guild.

Source

pub const fn nsfw_level(&self) -> NSFWLevel

NSFW level.

Source

pub const fn owner(&self) -> Option<bool>

Whether the current user is the owner of the guild.

Source

pub const fn owner_id(&self) -> Id<UserMarker>

ID of the guild’s owner.

Source

pub const fn permissions(&self) -> Option<Permissions>

Total permissions for the current user in the guild, excluding overwrites.

Source

pub fn preferred_locale(&self) -> &str

Preferred locale for Community guilds.

Used in server discovery and notices from Discord. Defaults to “en-US”.

Source

pub const fn premium_progress_bar_enabled(&self) -> bool

Whether the premium progress bar is enabled.

Source

pub const fn premium_subscription_count(&self) -> Option<u64>

Number of boosts this guild currently has.

Source

pub const fn premium_tier(&self) -> PremiumTier

Server boost level.

Source

pub const fn public_updates_channel_id(&self) -> Option<Id<ChannelMarker>>

ID of the where moderators of Community guilds receive notices from Discord.

Source

pub const fn rules_channel_id(&self) -> Option<Id<ChannelMarker>>

For Community guilds, the ID of the rules channel.

Source

pub const fn safety_alerts_channel_id(&self) -> Option<Id<ChannelMarker>>

The ID of the channel where admins and moderators of Community guilds receive safety alerts from Discord.

Source

pub const fn splash(&self) -> Option<&ImageHash>

Source

pub const fn system_channel_id(&self) -> Option<Id<ChannelMarker>>

ID of the channel where notices are posted.

Example notices include welcome messages and boost events.

Source

pub const fn system_channel_flags(&self) -> SystemChannelFlags

System channel flags.

Source

pub const fn unavailable(&self) -> Option<bool>

Whether the guild is unavailable due to an outage.

Source

pub fn vanity_url_code(&self) -> Option<&str>

Vanity URL code.

Source

pub const fn verification_level(&self) -> VerificationLevel

Required verification level.

Source

pub const fn widget_channel_id(&self) -> Option<Id<ChannelMarker>>

ID of the channel that a widget generates an invite to.

Source

pub const fn widget_enabled(&self) -> Option<bool>

Whether the widget is enabled.

Trait Implementations§

Source§

impl CacheableGuild for CachedGuild

Source§

fn id(&self) -> Id<GuildMarker>

ID of the guild.
Source§

fn owner_id(&self) -> Id<UserMarker>

Available on crate feature permission-calculator only.
ID of the guild’s owner.
Source§

fn set_unavailable(&mut self, unavailable: Option<bool>)

Set the guild’s unavailable flag.
Source§

fn update_with_guild_update(&mut self, guild_update: &GuildUpdate)

Update the cached data with a [GuildUpdate] event. Fields containing other cached structures such as channels are cleared prior.
Source§

fn increase_member_count(&mut self, amount: u64)

Increase the guild member count.
Source§

fn decrease_member_count(&mut self, amount: u64)

Decrease the guild member count.
Source§

impl Clone for CachedGuild

Source§

fn clone(&self) -> CachedGuild

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CachedGuild

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Guild> for CachedGuild

Source§

fn from(guild: Guild) -> Self

Converts to this type from the input type.
Source§

impl PartialEq<Guild> for CachedGuild

Source§

fn eq(&self, other: &Guild) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for CachedGuild

Source§

fn eq(&self, other: &CachedGuild) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CachedGuild

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CachedGuild

Source§

impl StructuralPartialEq for CachedGuild

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.