Class DiscordGuild
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
Represents a Discord guild.
public class DiscordGuild : SnowflakeObject, IEquatable<DiscordGuild>
- Inheritance
-
DiscordGuild
- Implements
- Inherited Members
Properties
- AfkChannel
Gets the guild's AFK voice channel.
- 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?, bool, CancellationToken) and having withCounts set to true.
- ApproximatePresenceCount
Gets the approximate number of presences in this guild, when using GetGuildAsync(ulong, bool?, bool, CancellationToken) and having withCounts set to true.
- BannerHash
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 the guild's features.
- HasMemberVerificationGate
Whether this guild has enabled membership screening.
- HasWelcomeScreen
Whether this guild has enabled the welcome screen.
- HomeHeaderHash
Gets the guild home header's hash.
- HomeHeaderUrl
Gets the guild home header's url.
- HubType
Gets this guild's hub type, if applicable.
- IconHash
Gets the guild icon's hash.
- IconUrl
Gets the guild icon's url.
- IncidentsData
Gets the guild incidents data.
- InventorySettings
Gets the guild inventory settings.
- IsCommunity
Whether this guild has the community feature enabled.
- 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.
- LatestOnboardingQuestionId
Gets the latest onboarding question id.
- MaxMembers
Gets the maximum amount of members allowed for this guild.
- MaxPresences
Gets the maximum amount of presences allowed for this guild.
- MaxStageVideoChannelUsers
Gets the maximum amount of users allowed per video stage channel.
- 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 a dictionary of all by position ordered channels associated with this guild. The dictionary's key is the channel ID.
- Owner
Gets the guild's owner.
- 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, interactions and notices from Discord. Defaults to en-US.
- PremiumProgressBarEnabled
Whether the premium progress bar is enabled.
- PremiumSubscriptionCount
Gets the amount of members that boosted this guild.
- PremiumTier
Gets this guild's premium tier (Nitro boosting).
- Presences
Gets a dictionary of the presences cached for this guild. The dictionary's key is the user ID. Computed on demand from the centralized presence store.
- PublicUpdatesChannel
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".
- RawFeatures
Gets a collection of this guild's features.
- RegisteredApplicationCommands
List of DiscordApplicationCommand. Null if DisCatSharp.ApplicationCommands is not used or no guild commands are registered.
- Roles
Gets a collection of this guild's roles.
- RulesChannel
Gets the rules channel for this guild.
This is only available if the guild is considered "discoverable".
- SafetyAltersChannel
Gets the safety alert channel for this guild.
- ScheduledEvents
Gets a dictionary of all scheduled events.
- SoundboardSounds
Gets a dictionary of all soundboard sounds.
- SplashHash
Gets the guild splash's hash.
- SplashUrl
Gets the guild splash's url.
- StageInstances
Gets a dictionary of all active stage instances. The dictionary's key is the stage ID.
- Stickers
Gets a collection of this guild's stickers.
- SystemChannel
Gets the channel where system messages (such as boost and welcome messages) are sent.
- SystemChannelFlags
Gets the settings for this guild's system channel.
- 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.
- WidgetChannel
Gets the widget channel for this guild.
- WidgetEnabled
Gets whether this guild's widget is enabled.
Methods
- AddMemberAsync(DiscordUser, string, string?, IEnumerable<DiscordRole>?, bool?, bool?, CancellationToken)
Adds a new member to this guild
- AttachUserIntegrationAsync(DiscordIntegration, CancellationToken)
Attaches an integration from current user to this guild.
- BanMemberAsync(DiscordMember, int, string?, CancellationToken)
Bans a specified DiscordMember from this guild.
- BanMemberAsync(DiscordUser, int, string?, CancellationToken)
Bans a specified DiscordUser. This doesn't require the user to be in this guild.
- BanMemberAsync(ulong, int, string, CancellationToken)
Bans a specified user ID from this guild. This doesn't require the user to be in this guild.
- BulkBanMembersAsync(List<DiscordMember>, int, string?, CancellationToken)
Bulk bans a list of DiscordMembers from this guild.
- BulkBanMembersAsync(List<DiscordUser>, int, string?, CancellationToken)
Bulk bans a list of DiscordUsers from this guild. This doesn't require the users to be in this guild.
- BulkBanMembersAsync(List<ulong>, int, string, CancellationToken)
Bans a list of user IDs from this guild. This doesn't require the users to be in this guild.
- BulkOverwriteApplicationCommandsAsync(IEnumerable<DiscordApplicationCommand>, CancellationToken)
Overwrites the existing application commands in this guild. New commands are automatically created and missing commands are automatically delete
- CreateApplicationCommandAsync(DiscordApplicationCommand, CancellationToken)
Creates or overwrites a application command in this guild.
- CreateAutomodRuleAsync(string, AutomodEventType, AutomodTriggerType, IEnumerable<AutomodAction>, AutomodTriggerMetadata, bool, IEnumerable<ulong>, IEnumerable<ulong>, string, CancellationToken)
Creates a new auto mod rule in a guild.
- CreateChannelAsync(string, ChannelType, DiscordChannel?, Optional<string>, int?, int?, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, VideoQualityMode?, ThreadAutoArchiveDuration?, Optional<ChannelFlags?>, string?, CancellationToken)
Creates a new channel in this guild.
- CreateChannelCategoryAsync(string, IEnumerable<DiscordOverwriteBuilder>, string, CancellationToken)
Creates a new channel category in this guild.
- CreateEmojiAsync(string, Stream, IEnumerable<DiscordRole>, string, CancellationToken)
Creates a new custom emoji for this guild.
- CreateExternalScheduledEventAsync(string, DateTimeOffset, DateTimeOffset, string, string, Optional<Stream>, DiscordScheduledEventRecurrenceRule?, string, CancellationToken)
Creates a scheduled event with type External.
- CreateForumChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<ForumReactionEmoji>, Optional<int?>, Optional<int?>, ThreadAutoArchiveDuration, Optional<ForumPostSortOrder>, Optional<ForumLayout?>, Optional<ChannelFlags?>, string?, CancellationToken)
Creates a new forum channel in this guild.
note
The field template is not yet released, so it won't applied.
- CreateNewsChannelAsync(string, IEnumerable<DiscordOverwriteBuilder>?, string?, ThreadAutoArchiveDuration, Optional<ChannelFlags?>, CancellationToken)
Creates a new news channel in this guild.
- CreateRoleAsync(string, Permissions?, DiscordColor?, bool?, bool?, string, CancellationToken)
Creates a new role in this guild.
- CreateScheduledEventAsync(string, DateTimeOffset, DateTimeOffset?, DiscordChannel, DiscordScheduledEventEntityMetadata, string, ScheduledEventEntityType, Optional<Stream>, DiscordScheduledEventRecurrenceRule?, string, CancellationToken)
Creates a scheduled event.
- CreateSoundboardSoundAsync(string, Stream, double?, ulong?, string?, string?)
Creates a new soundboard sound in the guild.
- CreateStageChannelAsync(string, IEnumerable<DiscordOverwriteBuilder>, string, CancellationToken)
Creates a new stage channel in this guild.
- CreateStickerAsync(string, string, DiscordEmoji, Stream, StickerFormat, string?, CancellationToken)
Creates a sticker
- CreateTemplateAsync(string, string?, CancellationToken)
Creates a guild template.
- CreateTextChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, ThreadAutoArchiveDuration, Optional<ChannelFlags?>, string?, CancellationToken)
Creates a new text channel in this guild.
- CreateVoiceChannelAsync(string, DiscordChannel?, int?, int?, IEnumerable<DiscordOverwriteBuilder>?, VideoQualityMode?, Optional<ChannelFlags?>, string?, CancellationToken)
Creates a new voice channel in this guild.
- CurrentMemberIsHigherThan(DiscordMember)
Checks whether the current member's top role is higher than another member's top role in the role hierarchy.
- CurrentMemberIsHigherThan(DiscordRole)
Checks whether the current member's top role is higher than a role in the role hierarchy.
- DeleteAllChannelsAsync()
Deletes all channels in this guild.
Note that this is irreversible. Use carefully!
- DeleteEmojiAsync(DiscordGuildEmoji, string?, CancellationToken)
Deletes this guild's custom emoji.
- DeleteIntegrationAsync(DiscordIntegration, CancellationToken)
Removes an integration from this guild.
- DeleteSoundboardSoundAsync(ulong, string?)
Deletes a soundboard sound from the guild.
- DeleteStickerAsync(DiscordSticker, string?, CancellationToken)
Deletes a sticker
- DeleteStickerAsync(ulong, string?, CancellationToken)
Deletes a sticker
- DeleteTemplateAsync(string, CancellationToken)
Deletes the template.
- DisableInvitesAsync(string?, CancellationToken)
Disables invites for the guild.
- DisableMfaAsync(string?, CancellationToken)
Disables the mfa requirement for this guild.
- EditApplicationCommandAsync(ulong, Action<ApplicationCommandEditModel>, CancellationToken)
Edits a application command in this guild.
- EnableInvitesAsync(string?, CancellationToken)
Enables invites for the guild.
- EnableMfaAsync(string?, CancellationToken)
Enables the mfa requirement for this guild.
- Equals(DiscordGuild)
Checks whether this DiscordGuild is equal to another DiscordGuild.
- Equals(object)
Checks whether this DiscordGuild is equal to another object.
- GetActiveThreadsAsync(CancellationToken)
Gets active threads. Can contain more threads. If the result's value 'HasMore' is true, you need to recall this function to get older threads.
- GetAllMembersAsync(CancellationToken)
Retrieves a full list of members from Discord. This method will bypass cache.
- GetApplicationCommandsAsync(CancellationToken)
Gets all the application commands in this guild.
- GetAuditLogEntriesAsync(DiscordAuditLogQuery?)
Fetches audit log entries for this guild.
- GetAuditLogsAsync(int?, DiscordMember?, AuditLogActionType?)
Fetches audit log entries for this guild.
- GetAutomodRuleAsync(ulong, CancellationToken)
Gets a specific auto mod rule.
- GetAutomodRulesAsync(CancellationToken)
Gets all auto mod rules for a guild.
- GetBanAsync(DiscordUser, CancellationToken)
Gets a ban for a specific user.
- GetBanAsync(ulong, CancellationToken)
Gets a ban for a specific user.
- GetBansAsync(int?, ulong?, ulong?, CancellationToken)
Gets the bans for this guild, allowing for pagination.
- GetChannel(ulong)
Gets a channel from this guild by its ID.
- GetChannelsAsync(CancellationToken)
Gets all the channels this guild has.
- GetCurrentMemberVoiceStateAsync(CancellationToken)
Gets the current guild member's voice state.
- GetDefaultChannel()
Gets the default channel for this guild.
Default channel is the first channel current member can see.
- GetEmojiAsync(ulong, CancellationToken)
Gets this guild's specified custom emoji.
- GetEmojisAsync(CancellationToken)
Gets all of this guild's custom emojis.
- GetHashCode()
Gets the hash code for this DiscordGuild.
- GetIntegrationsAsync(CancellationToken)
Gets integrations attached to this guild.
- GetInvite(string)
Gets an invite from this guild from an invite code.
- GetInvitesAsync(CancellationToken)
Gets all the invites created for all the channels in this guild.
- GetJoinRequestAsync(ulong, CancellationToken)
Gets a specific join request.
- GetJoinRequestsAsync(int, JoinRequestStatusType?, ulong?, ulong?, CancellationToken)
Gets the join requests.
- GetMemberAsync(ulong, bool, CancellationToken)
Gets a member of this guild by their user ID.
- GetMemberCountsAsync(CancellationToken)
Gets the number of members in each role.
- GetMemberVoiceStateAsync(ulong, CancellationToken)
Gets the current voice state for a member.
- GetMembershipScreeningFormAsync(CancellationToken)
Gets this guild's membership screening form.
- GetOnboardingAsync(CancellationToken)
Gets this guilds onboarding configuration.
- GetOrderedChannels()
Gets an ordered DiscordChannel list out of the channel cache. Returns a Dictionary where the key is an ulong and can be mapped to Category DiscordChannels. Ignore the 0 key here, because that indicates that this is the "has no category" list. Each value contains a ordered list of text/news and voice/stage channels as DiscordChannel.
- GetOrderedChannelsAsync(CancellationToken)
Gets an ordered DiscordChannel list. Returns a Dictionary where the key is an ulong and can be mapped to Category DiscordChannels. Ignore the 0 key here, because that indicates that this is the "has no category" list. Each value contains a ordered list of text/news and voice/stage channels as DiscordChannel.
- GetPruneCountAsync(int, IEnumerable<DiscordRole>?, CancellationToken)
Estimates the number of users to be pruned.
- GetRole(ulong)
Gets a role from this guild's cache by its ID.
- GetRoleAsync(ulong, CancellationToken)
Gets a role from this guild from the api by its ID.
- GetScheduledEventAsync(DiscordScheduledEvent, bool?, CancellationToken)
Gets a specific scheduled events.
- GetScheduledEventAsync(ulong, bool?, CancellationToken)
Gets a specific scheduled events.
- GetScheduledEventsAsync(bool?, CancellationToken)
Gets the guilds scheduled events.
- GetServerGuideAsync(CancellationToken)
Gets this guilds server guide configuration.
- GetSoundboardSoundAsync(ulong, CancellationToken)
Gets a soundboard sound by its ID.
- GetStickerAsync(ulong, CancellationToken)
Gets a sticker
- GetStickersAsync(CancellationToken)
Gets all of this guild's custom stickers.
- GetTemplatesAsync(CancellationToken)
Gets all of this guild's templates.
- GetThread(ulong)
Gets a thread from this guild by its ID.
- GetVanityInviteAsync(CancellationToken)
Gets the vanity invite for this guild.
- GetWebhooksAsync(CancellationToken)
Gets all the webhooks created for all the channels in this guild.
- GetWelcomeScreenAsync(CancellationToken)
Gets this guild's welcome screen.
- GetWidgetAsync(CancellationToken)
Gets the guild's widget
- GetWidgetImage(WidgetType)
Gets this guild's widget image.
- GetWidgetSettingsAsync(CancellationToken)
Gets the guild's widget settings
- LeaveAsync(CancellationToken)
Leaves this guild.
- ListSoundboardSoundsAsync()
Lists all soundboard sounds in the guild.
- ListVoiceRegionsAsync(CancellationToken)
Gets the voice regions for this guild.
- MemberIsHigherThan(DiscordMember, DiscordMember)
Checks whether a member's top role is higher than another member's top role in the role hierarchy.
- MemberIsHigherThan(DiscordMember, DiscordRole)
Checks whether a member's top role is higher than a role in the role hierarchy.
- ModifyAsync(Action<GuildEditModel>, CancellationToken)
Modifies this guild.
- ModifyCommunitySettingsAsync(bool, DiscordChannel, DiscordChannel, string, string, DefaultMessageNotifications, string?, CancellationToken)
Modifies the community settings async. This sets High if not highest and AllMembers.
- ModifyCurrentMemberAsync(Action<CurrentMemberEditModel>, CancellationToken)
Modifies the current bot member.
- ModifyEmojiAsync(DiscordGuildEmoji, string, IEnumerable<DiscordRole>, string, CancellationToken)
Modifies a this guild's custom emoji.
- ModifyIncidentActionsAsync(DateTimeOffset?, DateTimeOffset?, CancellationToken)
Disables invites for the guild.
- ModifyIntegrationAsync(DiscordIntegration, int, int, bool, CancellationToken)
Modifies an integration in this guild.
- ModifyInventorySettingsAsync(bool, string?, CancellationToken)
Modifies the guild's inventory settings.
- ModifyJoinRequestsAsync(ulong, bool, string?, CancellationToken)
Modifies a join request.
- ModifyMembershipScreeningFormAsync(Action<MembershipScreeningEditModel>, CancellationToken)
Modifies this guild's membership screening form.
- ModifyOnboardingAsync(Optional<List<DiscordOnboardingPrompt>>, Optional<List<ulong>>, Optional<bool>, Optional<OnboardingMode>, string?, CancellationToken)
Modifies this guilds onboarding configuration.
- ModifySafetyAlertsSettingsAsync(bool, DiscordChannel, string?, CancellationToken)
Modifies the safety alerts settings async.
- ModifyServerGuideAsync(Optional<bool>, Optional<WelcomeMessage>, Optional<List<NewMemberAction>>, Optional<List<ResourceChannel>>, string?, CancellationToken)
Modifies this guilds server guide configuration.
- ModifySoundboardSoundAsync(ulong, Action<SoundboardSoundEditModel>)
Modifies an existing soundboard sound.
- ModifyStickerAsync(DiscordSticker, Optional<string>, Optional<string>, Optional<DiscordEmoji>, string?, CancellationToken)
Modifies a sticker
- ModifyStickerAsync(ulong, Optional<string>, Optional<string>, Optional<DiscordEmoji>, string?, CancellationToken)
Modifies a sticker
- ModifyTemplateAsync(string, string?, string?, CancellationToken)
Modifies the template's metadata.
- ModifyWelcomeScreenAsync(Action<WelcomeScreenEditModel>, CancellationToken)
Modifies this guild's welcome screen.
- ModifyWidgetSettingsAsync(bool?, DiscordChannel?, string?, CancellationToken)
Modifies the guild's widget settings
- PruneAsync(int, bool, IEnumerable<DiscordRole>?, string?, CancellationToken)
Prunes inactive users from this guild.
- RemoveTimeoutAsync(ulong, string?, CancellationToken)
Removes the timeout from a specified member in this guild.
- 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
presencesandnonceare specified, this will request all guild members.
- RoleIsHigherThan(DiscordRole, DiscordRole)
Checks whether a role is higher than another role in the role hierarchy.
- SearchMembersAsync(string, int?, CancellationToken)
Searches the current guild for members who's display name start with the specified name.
- SyncIntegrationAsync(DiscordIntegration, CancellationToken)
Forces re-synchronization of an integration for this guild.
- SyncTemplateAsync(string, CancellationToken)
Syncs the template to the current guild's state.
- TimeoutAsync(ulong, DateTime, string?, CancellationToken)
Timeout a specified member in this guild.
- TimeoutAsync(ulong, DateTimeOffset, string?, CancellationToken)
Timeout a specified member in this guild.
- TimeoutAsync(ulong, TimeSpan, string?, CancellationToken)
Timeout a specified member in this guild.
- ToString()
Returns a string representation of this guild.
- TryGetBanAsync(DiscordUser, CancellationToken)
Tries to get a ban for a specific user.
- TryGetBanAsync(ulong, CancellationToken)
Tries to get a ban for a specific user.
- TryGetMember(ulong, out DiscordMember?)
Gets a member of this guild by their user ID.
- TryGetMemberAsync(ulong, bool, CancellationToken)
Gets a member of this guild by their user ID.
- TryGetScheduledEventAsync(DiscordScheduledEvent, bool?, CancellationToken)
Tries to get a specific scheduled events.
- TryGetScheduledEventAsync(ulong, bool?, CancellationToken)
Tries to get a specific scheduled events.
- UnbanMemberAsync(DiscordUser, string?, CancellationToken)
Unbans a user from this guild.
- UnbanMemberAsync(ulong, string?, CancellationToken)
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.