Table of Contents

Class DiscordGuild

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

Represents a Discord guild.

public class DiscordGuild : SnowflakeObject
Inheritance
object
DiscordGuild
Inherited Members

Properties

AfkChannelId

Gets the guild's AFK voice channel ID.

AfkTimeout

Gets the guild's AFK timeout.

ApplicationId

Gets the application ID of this guild if it is bot created.

ApproximateMemberCount

Gets the approximate number of members in this guild, when using GetGuildAsync(ulong, bool?) and having withCounts set to true.

ApproximatePresenceCount

Gets the approximate number of presences in this guild, when using GetGuildAsync(ulong, bool?) and having withCounts set to true.

Banner

Gets this guild's banner hash, when applicable.

BannerUrl

Gets this guild's banner in url form.

Channels

Gets a dictionary of all the channels associated with this guild. The dictionary's key is the channel ID.

CurrentMember

Gets the guild member for current user.

DefaultMessageNotifications

Gets the guild's default notification settings.

Description

Gets the guild description, when applicable.

DiscoverySplashHash

Gets the guild discovery splash's hash.

DiscoverySplashUrl

Gets the guild discovery splash's url.

Emojis

Gets a collection of this guild's emojis.

EveryoneRole

Gets the @everyone role for this guild.

ExplicitContentFilter

Gets the guild's explicit content filter settings.

Features

Gets a collection of this guild's features.

IconHash

Gets the guild icon's hash.

IconUrl

Gets the guild icon's url.

IsLarge

Gets whether this guild is considered to be a large guild.

IsNSFW

Gets whether this guild is designated as NSFW.

IsOwner

Gets whether the current user is the guild's owner.

IsUnavailable

Gets whether this guild is unavailable.

JoinedAt

Gets this guild's join date.

MaxMembers

Gets the maximum amount of members allowed for this guild.

MaxPresences

Gets the maximum amount of presences allowed for this guild.

MaxVideoChannelUsers

Gets the maximum amount of users allowed per video channel.

MemberCount

Gets the total number of members in this guild.

Members

Gets a dictionary of all the members that belong to this guild. The dictionary's key is the member ID.

MfaLevel

Gets the required multi-factor authentication level for this guild.

Name

Gets the guild's name.

NsfwLevel

Gets the guild's nsfw level.

OrderedChannels

Gets channels ordered in a manner in which they'd be ordered in the UI of the discord client.

OwnerId

Gets the ID of the guild's owner.

Permissions

Gets permissions for the user in the guild (does not include channel overrides)

PreferredLocale

Gets the preferred locale of this guild.

This is used for server discovery and notices from Discord. Defaults to en-US.

PremiumProgressBarEnabled

Whether the guild has the boost progress bar enabled.

PremiumSubscriptionCount

Gets the amount of members that boosted this guild.

PremiumTier

Gets this guild's premium tier (Nitro boosting).

PublicUpdatesChannelId

Id of the channel where admins and moderators receive messages from Discord

Roles

Gets a collection of this guild's roles.

RulesChannelId

Id of the rules channel of this guild. Null if the guild has no configured rules channel.

SafetyAlertsChannelId

Id of the channel where safety alerts are sent to

ScheduledEvents

Scheduled events for this guild.

SplashHash

Gets the guild splash's hash.

SplashUrl

Gets the guild splash's url.

StageInstances

Gets the stage instances in this guild.

Stickers

Gets a collection of this guild's stickers.

SystemChannelFlags

Gets the settings for this guild's system channel.

SystemChannelId

Id of the channel where system messages (such as boost and welcome messages) are sent.

Threads

Gets a dictionary of all the active threads associated with this guild the user has permission to view. The dictionary's key is the channel ID.

VanityUrlCode

Gets the vanity URL code for this guild, when applicable.

VerificationLevel

Gets the guild's verification level.

VoiceRegion

Gets the guild's voice region.

VoiceStates

Gets a dictionary of all the voice states for this guilds. The key for this dictionary is the ID of the user the voice state corresponds to.

WidgetChannelId

Id of the widget channel

WidgetEnabled

Gets whether this guild's widget is enabled.

Methods

AddMemberAsync(DiscordUser, string, string?, bool, bool)

Adds a new member to this guild

AddMemberAsync(ulong, string, string?, bool, bool)

Adds a new member to this guild

AddMemberWithRolesAsync(DiscordUser, string, IEnumerable<DiscordRole>, string?, bool, bool)

Adds a new member to this guild

AddMemberWithRolesAsync(DiscordUser, string, IEnumerable<ulong>, string?, bool, bool)

Adds a new member to this guild

AddMemberWithRolesAsync(ulong, string, IEnumerable<DiscordRole>, string?, bool, bool)

Adds a new member to this guild

AddMemberWithRolesAsync(ulong, string, IEnumerable<ulong>, string?, bool, bool)

Adds a new member to this guild

AttachUserIntegrationAsync(DiscordIntegration)

Attaches an integration from current user to this guild.

BanMemberAsync(DiscordUser, TimeSpan, string?)

Bans a specified member from this guild.

BanMemberAsync(ulong, TimeSpan, string?)

Bans a specified user by ID. This doesn't require the user to be in this guild.

BatchEditApplicationCommandPermissionsAsync(IEnumerable<DiscordGuildApplicationCommandPermissions>)

Batch edits permissions for a application command in this guild.

BulkBanMembersAsync(IEnumerable<DiscordUser>, int, string?)

Bans multiple users from this guild.

BulkBanMembersAsync(IEnumerable<ulong>, int, string?)

Bans multiple users from this guild by their id

BulkOverwriteApplicationCommandsAsync(IEnumerable<DiscordApplicationCommand>)

Overwrites the existing application commands in this guild. New commands are automatically created and missing commands are automatically delete

CancelEventAsync(DiscordScheduledGuildEvent)

Cancels an event. The event must be scheduled for it to be cancelled.

CreateApplicationCommandAsync(DiscordApplicationCommand)

Creates or overwrites a application command in this guild.

CreateAutoModerationRuleAsync(string, DiscordRuleEventType, DiscordRuleTriggerType, DiscordRuleTriggerMetadata, IReadOnlyList<DiscordAutoModerationAction>, Optional<bool>, Optional<IReadOnlyList<DiscordRole>>, Optional<IReadOnlyList<DiscordChannel>>, string?)

Creates an auto-moderation rule in the guild.

CreateChannelAsync(string, DiscordChannelType, DiscordChannel?, Optional<string>, int?, int?, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, DiscordVideoQualityMode?, int?, string?, DiscordAutoArchiveDuration?, DefaultReaction?, IEnumerable<DiscordForumTagBuilder>?, DiscordDefaultSortOrder?)

Creates a new channel in this guild.

CreateChannelCategoryAsync(string, IEnumerable<DiscordOverwriteBuilder>?, int?, string?)

Creates a new channel category in this guild.

CreateEmojiAsync(string, Stream, IEnumerable<DiscordRole>?, string?)

Creates a new custom emoji for this guild.

CreateEventAsync(string, string, ulong?, DiscordScheduledGuildEventType, DiscordScheduledGuildEventPrivacyLevel, DateTimeOffset, DateTimeOffset?, string?, Stream?, string?)

Creates a new scheduled event in this guild.

CreateRoleAsync(string?, DiscordPermissions?, DiscordColor?, bool?, bool?, string?, Stream?, DiscordEmoji?)

Creates a new role in this guild.

CreateStickerAsync(string, string, string, Stream, DiscordStickerFormat, string?)

Creates a sticker in this guild. Lottie stickers can only be created on verified and/or partnered servers.

CreateTemplateAsync(string, string?)

Creates a guild template.

CreateTextChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, int?, string?)

Creates a new text channel in this guild.

CreateVoiceChannelAsync(string, DiscordChannel?, int?, int?, IEnumerable<DiscordOverwriteBuilder>?, DiscordVideoQualityMode?, int?, string?)

Creates a new voice channel in this guild.

DeleteAllChannelsAsync()

Deletes all channels in this guild.

Note that this is irreversible. Use carefully!

DeleteAsync()

Deletes this guild. Requires the caller to be the owner of the guild.

DeleteAutoModerationRuleAsync(ulong, string?)

Deletes a auto-moderation rule by an id.

DeleteEmojiAsync(DiscordGuildEmoji, string?)

Deletes this guild's custom emoji.

DeleteEmojiAsync(ulong, string?)

Deletes this guild's custom emoji.

DeleteEventAsync(DiscordScheduledGuildEvent, string?)

Deletes an exising scheduled event in this guild.

DeleteEventAsync(ulong, string?)

Deletes an exising scheduled event in this guild.

DeleteIntegrationAsync(DiscordIntegration, string?)

Removes an integration from this guild.

DeleteIntegrationAsync(ulong, string?)

Removes an integration from this guild.

DeleteStickerAsync(DiscordMessageSticker, string?)

Deletes a sticker in this guild.

DeleteStickerAsync(ulong, string?)

Deletes a sticker in this guild.

DeleteTemplateAsync(string)

Deletes the template.

EditApplicationCommandAsync(ulong, Action<ApplicationCommandEditModel>)

Edits a application command in this guild.

EditApplicationCommandPermissionsAsync(DiscordApplicationCommand, IEnumerable<DiscordApplicationCommandPermission>)

Edits permissions for a application command in this guild.

EnumerateRequestMembersAsync(string, int, bool?, IEnumerable<ulong>?, string?, CancellationToken)

Requests that Discord send a list of guild members based on the specified arguments. This method will fire the GuildMembersChunked event.

If no arguments aside from presences and nonce are specified, this will request all guild members.

Equals(DiscordGuild)

Checks whether this DiscordGuild is equal to another DiscordGuild.

Equals(object)

Checks whether this DiscordGuild is equal to another object.

GetAfkChannelAsync(bool)

Gets the guild's AFK voice channel.

GetAllMembersAsync(CancellationToken)

Retrieves a full list of members from Discord. This method will bypass cache. This will execute one API request per 1000 entities.

GetApplicationCommandAsync(string, bool)

Gets a application command in this guild by its name.

GetApplicationCommandAsync(ulong)

Gets a application command in this guild by its id.

GetApplicationCommandPermissionsAsync(DiscordApplicationCommand)

Gets permissions for a application command in this guild.

GetApplicationCommandsAsync(bool)

Gets all the application commands in this guild.

GetApplicationCommandsPermissionsAsync()

Gets all application command permissions in this guild.

GetAuditLogsAsync(int?, DiscordMember?, DiscordAuditLogActionType?)

Gets audit log entries for this guild.

GetAutoModerationRuleAsync(ulong)

Gets an auto-moderation rule by an id.

GetAutoModerationRulesAsync()

Gets all auto-moderation rules in the guild.

GetBanAsync(DiscordUser)

Gets a ban for a specific user.

GetBanAsync(ulong)

Gets a ban for a specific user.

GetBansAsync(int?, ulong?, ulong?)

Gets the bans for this guild.

GetChannelAsync(ulong, bool)

Gets a channel from this guild by its ID.

GetChannelsAsync()

Gets all the channels this guild has.

GetDefaultChannel()

Gets the default channel for this guild.

Default channel is the first channel current member can see.

GetEmojiAsync(ulong)

Gets this guild's specified custom emoji.

GetEmojisAsync()

Gets all of this guild's custom emojis.

GetEventUsersAsync(DiscordScheduledGuildEvent, int, ulong?, ulong?)

Gets a list of users who are interested in this event.

GetEventUsersAsync(ulong, int, ulong?, ulong?)

Gets a list of users who are interested in this event.

GetEventsAsync(bool)

Gets the currently active or scheduled events in this guild.

GetGuildOwnerAsync()

Gets the guild's owner.

GetHashCode()

Gets the hash code for this DiscordGuild.

GetIconUrl(ImageFormat, ushort)

Gets guild's icon URL, in requested format and size.

GetIntegrationsAsync()

Gets integrations attached to this guild.

GetInvite(string)

Gets an invite from this guild from an invite code.

GetInvitesAsync()

Gets all the invites created for all the channels in this guild.

GetMemberAsync(ulong, bool)

Gets a member of this guild by their user ID.

GetMembershipScreeningFormAsync()

Gets this guild's membership screening form.

GetPruneCountAsync(int, IEnumerable<DiscordRole>)

Estimates the number of users to be pruned.

GetPruneCountAsync(int, IEnumerable<ulong>?)

Estimates the number of users to be pruned.

GetPublicUpdatesChannelAsync(bool)

Gets the public updates channel (where admins and moderators receive messages from Discord) for this guild.

This is only available if the guild is considered "discoverable".

GetRoleAsync(ulong, bool)

Gets a singular role from this guild by its ID.

GetRolesAsync()

Gets the roles in this guild.

GetRulesChannelAsync(bool)

Gets the rules channel for this guild.

This is only available if the guild is considered "discoverable".

GetSafetyAlertsChannelAsync(bool)

Gets the guild's safety alerts channel.

GetStickerAsync(ulong)

Gets a sticker from this guild.

GetStickersAsync()

Gets a list of stickers from this guild.

GetSystemChannelAsync(bool)

Gets the channel where system messages (such as boost and welcome messages) are sent.

GetTemplatesAsync()

Gets all of this guild's templates.

GetVanityInviteAsync()

Gets the vanity invite for this guild.

GetWebhooksAsync()

Gets all the webhooks created for all the channels in this guild.

GetWelcomeScreenAsync()

Gets this guild's welcome screen.

GetWidgetAsync()

Gets the guild's widget

GetWidgetChannelAsync(bool)

Gets the widget channel for this guild.

GetWidgetImage(DiscordWidgetType)

Gets this guild's widget image.

GetWidgetSettingsAsync()

Gets the guild's widget settings

LeaveAsync()

Leaves this guild.

ListActiveThreadsAsync()

Gets the active and private threads for this guild.

ListVoiceRegionsAsync()

Gets the voice regions for this guild.

ModifyAsync(Action<GuildEditModel>)

Modifies this guild.

ModifyAutoModerationRuleAsync(ulong, Action<AutoModerationRuleEditModel>)

Modify an auto-moderation rule in the guild.

ModifyEmojiAsync(DiscordGuildEmoji, string, IEnumerable<DiscordRole>?, string?)

Modifies a this guild's custom emoji.

ModifyEventAsync(DiscordScheduledGuildEvent, Action<ScheduledGuildEventEditModel>, string?)

Modifies an existing scheduled event in this guild.

ModifyIntegrationAsync(DiscordIntegration, int, int, bool)

Modifies an integration in this guild.

ModifyIntegrationAsync(ulong, int, int, bool)

Modifies an integration in this guild.

ModifyMembershipScreeningFormAsync(Action<MembershipScreeningEditModel>)

Modifies this guild's membership screening form.

ModifyRolePositionsAsync(IDictionary<int, DiscordRole>, string?)

Batch modifies the role order in the guild.

ModifyStickerAsync(DiscordMessageSticker, Action<StickerEditModel>, string?)

Modifies a sticker in this guild.

ModifyStickerAsync(ulong, Action<StickerEditModel>, string?)

Modifies a sticker in this guild.

ModifyTemplateAsync(string, string?, string?)

Modifies the template's metadata.

ModifyWelcomeScreenAsync(Action<WelcomeScreenEditModel>, string?)

Modifies this guild's welcome screen.

ModifyWidgetSettingsAsync(bool?, DiscordChannel?, string?)

Modifies the guild's widget settings

PruneAsync(int, bool, IEnumerable<DiscordRole>?, string?)

Prunes inactive users from this guild.

PruneAsync(int, bool, IEnumerable<ulong>?, string?)

Prunes inactive users from this guild.

RemoveMemberAsync(DiscordUser, string?)

Removes a specified member from this guild.

RemoveMemberAsync(ulong, string?)

Removes a specified member by ID.

RequestMembersAsync(string, int, bool?, IEnumerable<ulong>?, string?)

Requests that Discord send a list of guild members based on the specified arguments. This method will fire the GuildMembersChunked event.

If no arguments aside from presences and nonce are specified, this will request all guild members.

SearchMembersAsync(string, int?)

Searches the current guild for members who's display name start with the specified name.

StartEventAsync(DiscordScheduledGuildEvent)

Starts a scheduled event in this guild.

SyncIntegrationAsync(DiscordIntegration)

Forces re-synchronization of an integration for this guild.

SyncIntegrationAsync(ulong)

Forces re-synchronization of an integration for this guild.

SyncTemplateAsync(string)

Syncs the template to the current guild's state.

ToString()

Returns a string representation of this guild.

UnbanMemberAsync(DiscordUser, string?)

Unbans a user from this guild.

UnbanMemberAsync(ulong, string?)

Unbans a user by ID.

Operators

operator ==(DiscordGuild, DiscordGuild)

Gets whether the two DiscordGuild objects are equal.

operator !=(DiscordGuild, DiscordGuild)

Gets whether the two DiscordGuild objects are not equal.