Struct discord_flows::model::Guild
source · 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
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: u64The 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: DefaultMessageNotificationLevelIndicator 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: ExplicitContentFilterDefault 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_ICONBANNERCOMMERCECOMMUNITYDISCOVERABLEFEATURABLEINVITE_SPLASHMEMBER_VERIFICATION_GATE_ENABLEDMONETIZATION_ENABLEDMORE_STICKERSNEWSPARTNEREDPREVIEW_ENABLEDPRIVATE_THREADSROLE_ICONSSEVEN_DAY_THREAD_ARCHIVETHREE_DAY_THREAD_ARCHIVETICKETED_EVENTS_ENABLEDVANITY_URLVERIFIEDVIP_REGIONSWELCOME_SCREEN_ENABLEDTHREE_DAY_THREAD_ARCHIVESEVEN_DAY_THREAD_ARCHIVEPRIVATE_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: GuildIdThe unique Id identifying the guild.
This is equivalent to the Id of the default role (@everyone).
joined_at: TimestampThe date that the current user joined the guild.
large: boolIndicator of whether the guild is considered “large” by Discord.
member_count: u64The 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: MfaLevelIndicator of whether the guild requires multi-factor authentication for
Roles or Users with moderation permissions.
name: StringThe name of the guild.
owner_id: UserIdThe 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: SystemChannelFlagsSystem 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: VerificationLevelIndicator 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.
The server’s premium boosting level.
The total number of users currently boosting this server.
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: StringThe 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: NsfwLevelThe 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<'de> Deserialize<'de> for Guild
impl<'de> Deserialize<'de> for Guild
source§fn deserialize<D>(
deserializer: D
) -> Result<Guild, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Guild, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl From<Guild> for PartialGuild
impl From<Guild> for PartialGuild
source§fn from(guild: Guild) -> PartialGuild
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