#[non_exhaustive]pub struct Guild {Show 44 fields
pub id: GuildId,
pub name: CompactString,
pub icon: Option<ImageHash>,
pub icon_hash: Option<ImageHash>,
pub splash: Option<ImageHash>,
pub discovery_splash: Option<ImageHash>,
pub owner: bool,
pub owner_id: UserId,
pub permissions: Option<Permissions>,
pub region: Option<CompactString>,
pub afk_channel_id: Option<ChannelId>,
pub afk_timeout: u32,
pub widget_enabled: bool,
pub widget_channel_id: Option<ChannelId>,
pub verification_level: VerificationLevel,
pub default_message_notifications: DefaultMessageNotificationLevel,
pub explicit_content_filter: ExplicitContentFilterLevel,
pub roles: Vec<Role>,
pub emojis: Vec<Emoji>,
pub features: Vec<Feature>,
pub mfa_level: MfaLevel,
pub application_id: Option<ApplicationId>,
pub system_channel_id: Option<ChannelId>,
pub system_channel_flags: SystemChannelFlags,
pub rules_channel_id: Option<ChannelId>,
pub max_presences: Option<u32>,
pub max_members: Option<u32>,
pub vanity_url_code: Option<CompactString>,
pub description: Option<CompactString>,
pub banner: Option<ImageHash>,
pub premium_tier: PremiumTier,
pub premium_subscription_count: Option<u32>,
pub preferred_locale: Locale,
pub public_updates_channel_id: Option<ChannelId>,
pub max_video_channel_users: Option<u32>,
pub max_stage_video_channel_users: Option<u32>,
pub approximate_member_count: Option<u32>,
pub approximate_presence_count: Option<u32>,
pub welcome_screen: Option<Box<WelcomeScreen>>,
pub nsfw_level: AgeRestrictionLevel,
pub stickers: Vec<Sticker>,
pub premium_progress_bar_enabled: bool,
pub safety_alerts_channel_id: Option<ChannelId>,
pub incidents_data: Option<Box<IncidentsData>>,
}Expand description
A guild (called a “server” in the Discord client).
This is the shape returned by GET /guilds/{guild.id} and sent in GUILD_UPDATE. The
GUILD_CREATE event carries additional data (members, channels, …) in its own payload type.
discord.js counterpart: Guild.
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.id: GuildIdThe guild’s ID.
name: CompactStringThe guild’s name (2-100 characters).
icon: Option<ImageHash>The icon hash.
icon_hash: Option<ImageHash>The icon hash as sent in guild template objects.
splash: Option<ImageHash>The invite splash hash.
discovery_splash: Option<ImageHash>The discovery splash hash;
only for guilds with the DISCOVERABLE feature.
owner: boolWhether the current user owns the guild (only in GET /users/@me/guilds).
owner_id: UserIdThe owner’s user ID.
permissions: Option<Permissions>The current user’s permissions in the guild, without channel overwrites (only in
GET /users/@me/guilds).
region: Option<CompactString>The guild’s voice region. Deprecated by Discord: regions are set per voice channel.
afk_channel_id: Option<ChannelId>The AFK voice channel.
afk_timeout: u32How long a member must be idle before being moved to the AFK channel, in seconds.
widget_enabled: boolWhether the server widget is enabled.
widget_channel_id: Option<ChannelId>The channel the widget’s invite points to; None when the widget has no invite.
verification_level: VerificationLevelWhat members must have before they can talk in the guild.
default_message_notifications: DefaultMessageNotificationLevelThe default notification setting for members.
explicit_content_filter: ExplicitContentFilterLevelWhose media Discord scans for explicit content.
roles: Vec<Role>The guild’s roles.
emojis: Vec<Emoji>The guild’s custom emojis.
features: Vec<Feature>The guild’s enabled features.
mfa_level: MfaLevelWhether moderators need two-factor authentication.
application_id: Option<ApplicationId>The application that created the guild, for bot-created guilds.
system_channel_id: Option<ChannelId>The channel where welcome messages and boost notices are posted.
system_channel_flags: SystemChannelFlagsWhich notices are not posted in the system channel.
rules_channel_id: Option<ChannelId>The rules channel of a Community guild.
max_presences: Option<u32>The maximum number of presences (None except for the largest guilds).
max_members: Option<u32>The maximum number of members.
vanity_url_code: Option<CompactString>The vanity invite code (discord.gg/<code>).
description: Option<CompactString>The guild’s description.
The banner hash.
The Server Boost level.
The number of boosts the guild currently has.
preferred_locale: LocaleThe preferred locale of a Community guild (used in discovery and Discord notices).
public_updates_channel_id: Option<ChannelId>The channel where moderators of a Community guild receive notices from Discord.
max_video_channel_users: Option<u32>The maximum number of users in a video channel.
max_stage_video_channel_users: Option<u32>The maximum number of users in a stage video channel.
approximate_member_count: Option<u32>The approximate number of members (GET /guilds/{guild.id}?with_counts=true).
approximate_presence_count: Option<u32>The approximate number of online members (with_counts=true).
welcome_screen: Option<Box<WelcomeScreen>>The welcome screen of a Community guild (sent with invites).
nsfw_level: AgeRestrictionLevelThe guild’s age-restriction (NSFW) level. Defaults to
Default when absent (older payloads).
stickers: Vec<Sticker>The guild’s custom stickers.
Whether the boost progress bar is shown.
safety_alerts_channel_id: Option<ChannelId>The channel where moderators of a Community guild receive safety alerts.
incidents_data: Option<Box<IncidentsData>>Active safety incidents (paused invites or DMs, detected raids or DM spam).