pub struct Guild {
Show 45 fields pub afk_channel_id: Option<ChannelId>, pub afk_timeout: u64, pub application_id: Option<ApplicationId>, pub channels: HashMap<ChannelId, Channel, RandomState>, pub default_message_notifications: DefaultMessageNotificationLevel, pub emojis: HashMap<EmojiId, Emoji, RandomState>, pub explicit_content_filter: ExplicitContentFilter, pub features: Vec<String, Global>, pub icon: Option<String>, pub id: GuildId, pub joined_at: Timestamp, pub large: bool, pub member_count: u64, pub members: HashMap<UserId, Member, RandomState>, pub mfa_level: MfaLevel, pub name: String, pub owner_id: UserId, pub presences: HashMap<UserId, Presence, RandomState>, pub roles: HashMap<RoleId, Role, RandomState>, pub splash: Option<String>, pub discovery_splash: Option<String>, pub system_channel_id: Option<ChannelId>, pub system_channel_flags: SystemChannelFlags, pub rules_channel_id: Option<ChannelId>, pub public_updates_channel_id: Option<ChannelId>, pub verification_level: VerificationLevel, pub voice_states: HashMap<UserId, VoiceState, RandomState>, pub description: Option<String>, pub premium_tier: PremiumTier, pub premium_subscription_count: u64, pub banner: Option<String>, pub vanity_url_code: Option<String>, pub preferred_locale: String, pub welcome_screen: Option<GuildWelcomeScreen>, pub approximate_member_count: Option<u64>, pub approximate_presence_count: Option<u64>, pub nsfw_level: NsfwLevel, pub max_video_channel_users: Option<u64>, pub max_presences: Option<u64>, pub max_members: Option<u64>, pub widget_enabled: Option<bool>, pub widget_channel_id: Option<ChannelId>, pub stage_instances: Vec<StageInstance, Global>, pub threads: Vec<GuildChannel, Global>, pub stickers: HashMap<StickerId, Sticker, RandomState>,
}
Expand description

Information about a Discord guild, such as channels, emojis, etc.

Discord docs plus extension.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§afk_channel_id: Option<ChannelId>

Id of a voice channel that’s considered the AFK channel.

§afk_timeout: u64

The amount of seconds a user can not show any activity in a voice channel before being moved to an AFK channel – if one exists.

§application_id: Option<ApplicationId>

Application ID of the guild creator if it is bot-created.

§channels: HashMap<ChannelId, Channel, RandomState>

All voice and text channels contained within a guild.

This contains all channels regardless of permissions (i.e. the ability of the bot to read from or connect to them).

§default_message_notifications: DefaultMessageNotificationLevel

Indicator of whether notifications for all messages are enabled by default in the guild.

§emojis: HashMap<EmojiId, Emoji, RandomState>

All of the guild’s custom emojis.

§explicit_content_filter: ExplicitContentFilter

Default explicit content filter level.

§features: Vec<String, Global>

The guild features. More information available at discord documentation.

The following is a list of known features:

  • ANIMATED_ICON
  • BANNER
  • COMMERCE
  • COMMUNITY
  • DISCOVERABLE
  • FEATURABLE
  • INVITE_SPLASH
  • MEMBER_VERIFICATION_GATE_ENABLED
  • MONETIZATION_ENABLED
  • MORE_STICKERS
  • NEWS
  • PARTNERED
  • PREVIEW_ENABLED
  • PRIVATE_THREADS
  • ROLE_ICONS
  • SEVEN_DAY_THREAD_ARCHIVE
  • THREE_DAY_THREAD_ARCHIVE
  • TICKETED_EVENTS_ENABLED
  • VANITY_URL
  • VERIFIED
  • VIP_REGIONS
  • WELCOME_SCREEN_ENABLED
  • THREE_DAY_THREAD_ARCHIVE
  • SEVEN_DAY_THREAD_ARCHIVE
  • PRIVATE_THREADS
§icon: Option<String>

The hash of the icon used by the guild.

In the client, this appears on the guild list on the left-hand side.

§id: GuildId

The unique Id identifying the guild.

This is equivalent to the Id of the default role (@everyone).

§joined_at: Timestamp

The date that the current user joined the guild.

§large: bool

Indicator of whether the guild is considered “large” by Discord.

§member_count: u64

The number of members in the guild.

§members: HashMap<UserId, Member, RandomState>

Users who are members of the guild.

Members might not all be available when the ReadyEvent is received if the Self::member_count is greater than the [LARGE_THRESHOLD] set by the library.

§mfa_level: MfaLevel

Indicator of whether the guild requires multi-factor authentication for Roles or Users with moderation permissions.

§name: String

The name of the guild.

§owner_id: UserId

The Id of the User who owns the guild.

§presences: HashMap<UserId, Presence, RandomState>

A mapping of Users’ Ids to their current presences.

Note: This will be empty unless the “guild presences” privileged intent is enabled.

§roles: HashMap<RoleId, Role, RandomState>

A mapping of the guild’s roles.

§splash: Option<String>

An identifying hash of the guild’s splash icon.

If the InviteSplash feature is enabled, this can be used to generate a URL to a splash image.

§discovery_splash: Option<String>

An identifying hash of the guild discovery’s splash icon.

Note: Only present for guilds with the DISCOVERABLE feature.

§system_channel_id: Option<ChannelId>

The ID of the channel to which system messages are sent.

§system_channel_flags: SystemChannelFlags

System channel flags.

§rules_channel_id: Option<ChannelId>

The id of the channel where rules and/or guidelines are displayed.

Note: Only available on COMMUNITY guild, see Self::features.

§public_updates_channel_id: Option<ChannelId>

The id of the channel where admins and moderators of Community guilds receive notices from Discord.

Note: Only available on COMMUNITY guild, see Self::features.

§verification_level: VerificationLevel

Indicator of the current verification level of the guild.

§voice_states: HashMap<UserId, VoiceState, RandomState>

A mapping of Users to their current voice state.

§description: Option<String>

The server’s description, if it has one.

§premium_tier: PremiumTier

The server’s premium boosting level.

§premium_subscription_count: u64

The total number of users currently boosting this server.

§banner: Option<String>

The guild’s banner, if it has one.

§vanity_url_code: Option<String>

The vanity url code for the guild, if it has one.

§preferred_locale: String

The preferred locale of this guild only set if guild has the “DISCOVERABLE” feature, defaults to en-US.

§welcome_screen: Option<GuildWelcomeScreen>

The welcome screen of the guild.

Note: Only available on COMMUNITY guild, see Self::features.

§approximate_member_count: Option<u64>

Approximate number of members in this guild.

§approximate_presence_count: Option<u64>

Approximate number of non-offline members in this guild.

§nsfw_level: NsfwLevel

The guild NSFW state. See discord support article.

§max_video_channel_users: Option<u64>

The maximum amount of users in a video channel.

§max_presences: Option<u64>

The maximum number of presences for the guild. The default value is currently 25000.

Note: It is in effect when it is None.

§max_members: Option<u64>

The maximum number of members for the guild.

§widget_enabled: Option<bool>

Whether or not the guild widget is enabled.

§widget_channel_id: Option<ChannelId>

The channel id that the widget will generate an invite to, or null if set to no invite

§stage_instances: Vec<StageInstance, Global>

The stage instances in this guild.

§threads: Vec<GuildChannel, Global>

All active threads in this guild that current user has permission to view.

§stickers: HashMap<StickerId, Sticker, RandomState>

All of the guild’s custom stickers.

Trait Implementations§

source§

impl Clone for Guild

source§

fn clone(&self) -> Guild

Returns a copy 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 Guild

source§

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

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

impl<'de> Deserialize<'de> for Guild

source§

fn deserialize<D>( deserializer: D ) -> Result<Guild, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> From<&'a Guild> for GuildId

source§

fn from(live_guild: &Guild) -> GuildId

Gets the Id of Guild.

source§

impl From<Guild> for GuildId

source§

fn from(live_guild: Guild) -> GuildId

Gets the Id of Guild.

source§

impl From<Guild> for PartialGuild

source§

fn from(guild: Guild) -> PartialGuild

Converts this Guild instance into a PartialGuild

PartialGuild is not a strict subset and contains some data specific to the current user that Guild does not contain. Therefore, this method needs access to cache and HTTP to generate the missing data

source§

impl Serialize for Guild

source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Guild

§

impl Send for Guild

§

impl Sync for Guild

§

impl Unpin for Guild

§

impl UnwindSafe for Guild

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,