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) and having withCounts set to true.
- ApproximatePresenceCount
Gets the approximate number of presences in this guild, when using GetGuildAsync(ulong, bool?, bool) 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).
- 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.
- 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?)
Adds a new member to this guild
- AttachUserIntegrationAsync(DiscordIntegration)
Attaches an integration from current user to this guild.
- BanMemberAsync(DiscordMember, int, string?)
Bans a specified DiscordMember from this guild.
- BanMemberAsync(DiscordUser, int, string?)
Bans a specified DiscordUser. This doesn't require the user to be in this guild.
- BanMemberAsync(ulong, int, string)
Bans a specified user ID from this guild. This doesn't require the user to be in this guild.
- BulkBanMembersAsync(List<DiscordMember>, int, string?)
Bulk bans a list of DiscordMembers from this guild.
- BulkBanMembersAsync(List<DiscordUser>, int, string?)
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)
Bans a list of user IDs from this guild. This doesn't require the users to be in this guild.
- BulkOverwriteApplicationCommandsAsync(IEnumerable<DiscordApplicationCommand>)
Overwrites the existing application commands in this guild. New commands are automatically created and missing commands are automatically delete
- CreateApplicationCommandAsync(DiscordApplicationCommand)
Creates or overwrites a application command in this guild.
- CreateAutomodRuleAsync(string, AutomodEventType, AutomodTriggerType, IEnumerable<AutomodAction>, AutomodTriggerMetadata, bool, IEnumerable<ulong>, IEnumerable<ulong>, string)
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)
Creates a new channel in this guild.
- CreateChannelCategoryAsync(string, IEnumerable<DiscordOverwriteBuilder>, string)
Creates a new channel category in this guild.
- CreateEmojiAsync(string, Stream, IEnumerable<DiscordRole>, string)
Creates a new custom emoji for this guild.
- CreateExternalScheduledEventAsync(string, DateTimeOffset, DateTimeOffset, string, string, Optional<Stream>, string)
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)
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?>)
Creates a new news channel in this guild.
- CreateRoleAsync(string, Permissions?, DiscordColor?, bool?, bool?, string)
Creates a new role in this guild.
- CreateScheduledEventAsync(string, DateTimeOffset, DateTimeOffset?, DiscordChannel, DiscordScheduledEventEntityMetadata, string, ScheduledEventEntityType, Optional<Stream>, string)
Creates a scheduled event.
- CreateStageChannelAsync(string, IEnumerable<DiscordOverwriteBuilder>, string)
Creates a new stage channel in this guild.
- CreateTemplateAsync(string, string)
Creates a guild template.
- CreateTextChannelAsync(string, DiscordChannel, Optional<string>, IEnumerable<DiscordOverwriteBuilder>, bool?, Optional<int?>, ThreadAutoArchiveDuration, Optional<ChannelFlags?>, string)
Creates a new text channel in this guild.
- CreateVoiceChannelAsync(string, DiscordChannel, int?, int?, IEnumerable<DiscordOverwriteBuilder>, VideoQualityMode?, Optional<ChannelFlags?>, 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.
- DeleteEmojiAsync(DiscordGuildEmoji, string)
Deletes this guild's custom emoji.
- DeleteIntegrationAsync(DiscordIntegration)
Removes an integration from this guild.
- DeleteStickerAsync(DiscordSticker, string)
Deletes a sticker
- DeleteStickerAsync(ulong, string)
Deletes a sticker
- DeleteTemplateAsync(string)
Deletes the template.
- DisableInvitesAsync(string?)
Disables invites for the guild.
- DisableMfaAsync(string?)
Disables the mfa requirement for this guild.
- EditApplicationCommandAsync(ulong, Action<ApplicationCommandEditModel>)
Edits a application command in this guild.
- EnableInvitesAsync(string?)
Enables invites for the guild.
- EnableMfaAsync(string?)
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()
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()
Retrieves a full list of members from Discord. This method will bypass cache.
- GetApplicationCommandsAsync()
Gets all the application commands in this guild.
- GetAuditLogsAsync(int?, DiscordMember, AuditLogActionType?)
Gets audit log entries for this guild.
- GetAutomodRuleAsync(ulong)
Gets a specific auto mod rule.
- GetAutomodRulesAsync()
Gets all auto mod rules for a 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, allowing for pagination.
- GetChannel(ulong)
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.
- GetHashCode()
Gets the hash code for this DiscordGuild.
- 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.
- GetOnboardingAsync()
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 CategoryDiscordChannels. 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()
Gets an ordered DiscordChannel list. Returns a Dictionary where the key is an ulong and can be mapped to CategoryDiscordChannels. 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>)
Estimates the number of users to be pruned.
- GetRole(ulong)
Gets a role from this guild by its ID.
- GetScheduledEventAsync(DiscordScheduledEvent, bool?)
Gets a specific scheduled events.
- GetScheduledEventAsync(ulong, bool?)
Gets a specific scheduled events.
- GetScheduledEventsAsync(bool?)
Gets the guilds scheduled events.
- GetServerGuideAsync()
Gets this guilds server guide configuration.
- GetStickerAsync(ulong)
Gets a sticker
- GetStickersAsync()
Gets all of this guild's custom stickers.
- GetTemplatesAsync()
Gets all of this guild's templates.
- GetThread(ulong)
Gets a thread from this guild by its ID.
- 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
- GetWidgetImage(WidgetType)
Gets this guild's widget image.
- GetWidgetSettingsAsync()
Gets the guild's widget settings
- LeaveAsync()
Leaves this guild.
- ListVoiceRegionsAsync()
Gets the voice regions for this guild.
- ModifyAsync(Action<GuildEditModel>)
Modifies this guild.
- ModifyCommunitySettingsAsync(bool, DiscordChannel, DiscordChannel, string, string, DefaultMessageNotifications, string?)
Modifies the community settings async. This sets High if not highest and AllMembers.
- ModifyEmojiAsync(DiscordGuildEmoji, string, IEnumerable<DiscordRole>, string)
Modifies a this guild's custom emoji.
- ModifyIncidentActionsAsync(DateTimeOffset?, DateTimeOffset?)
Disables invites for the guild.
- ModifyIntegrationAsync(DiscordIntegration, int, int, bool)
Modifies an integration in this guild.
- ModifyInventorySettingsAsync(bool, string?)
Modifies the guild's inventory settings.
- ModifyMembershipScreeningFormAsync(Action<MembershipScreeningEditModel>)
Modifies this guild's membership screening form.
- ModifyOnboardingAsync(Optional<List<DiscordOnboardingPrompt>>, Optional<List<ulong>>, Optional<bool>, Optional<OnboardingMode>, string?)
Modifies this guilds onboarding configuration.
- ModifySafetyAlertsSettingsAsync(bool, DiscordChannel, string?)
Modifies the safety alerts settings async.
- ModifyServerGuideAsync(Optional<bool>, Optional<WelcomeMessage>, Optional<List<NewMemberAction>>, Optional<List<ResourceChannel>>, string?)
Modifies this guilds server guide configuration.
- ModifyStickerAsync(DiscordSticker, Optional<string>, Optional<string>, Optional<DiscordEmoji>, string)
Modifies a sticker
- ModifyStickerAsync(ulong, Optional<string>, Optional<string>, Optional<DiscordEmoji>, string)
Modifies a sticker
- ModifyTemplateAsync(string, string, string)
Modifies the template's metadata.
- ModifyWelcomeScreenAsync(Action<WelcomeScreenEditModel>)
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.
- RemoveTimeoutAsync(ulong, string?)
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
presences
andnonce
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.
- SyncIntegrationAsync(DiscordIntegration)
Forces re-synchronization of an integration for this guild.
- SyncTemplateAsync(string)
Syncs the template to the current guild's state.
- TimeoutAsync(ulong, DateTime, string?)
Timeout a specified member in this guild.
- TimeoutAsync(ulong, DateTimeOffset, string?)
Timeout a specified member in this guild.
- TimeoutAsync(ulong, TimeSpan, string?)
Timeout a specified member in this guild.
- ToString()
Returns a string representation of this guild.
- TryGetBanAsync(DiscordUser)
Tries to get a ban for a specific user.
- TryGetBanAsync(ulong)
Tries to get a ban for a specific user.
- TryGetScheduledEventAsync(DiscordScheduledEvent, bool?)
Tries to get a specific scheduled events.
- TryGetScheduledEventAsync(ulong, bool?)
Tries to get a specific scheduled events.
- 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.