Class RestGuild
Represents an isolated collection of users and channels, often referred to as a server in the UI.
public class RestGuild : ClientEntity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonGuild>, IComparer<PartialGuildUser>
- Inheritance
-
RestGuild
- Implements
- Derived
- Inherited Members
Constructors
RestGuild(JsonGuild, RestClient)
public RestGuild(JsonGuild jsonModel, RestClient client)
Parameters
jsonModel
JsonGuildclient
RestClient
Properties
AfkChannelId
ID of the RestGuild's AFK channel.
public ulong? AfkChannelId { get; }
Property Value
AfkTimeout
How long in seconds to wait before moving users to the AFK channel.
public int AfkTimeout { get; }
Property Value
ApplicationId
The RestGuild creator's application ID, if it was created by a bot.
public ulong? ApplicationId { get; }
Property Value
ApproximatePresenceCount
public int? ApproximatePresenceCount { get; }
Property Value
- int?
Remarks
Only available in objects returned from GetGuildAsync(ulong, bool, RestRequestProperties?, CancellationToken) and GetCurrentUserGuildsAsync(GuildsPaginationProperties?, RestRequestProperties?), where withCounts
is true.
ApproximateUserCount
public int? ApproximateUserCount { get; }
Property Value
- int?
Remarks
Only available in objects returned from GetGuildAsync(ulong, bool, RestRequestProperties?, CancellationToken) and GetCurrentUserGuildsAsync(GuildsPaginationProperties?, RestRequestProperties?), where withCounts
is true.
BannerHash
The RestGuild's banner hash.
public string? BannerHash { get; }
Property Value
ContentFilter
The RestGuild's ContentFilter.
public ContentFilter ContentFilter { get; }
Property Value
DefaultMessageNotificationLevel
public DefaultMessageNotificationLevel DefaultMessageNotificationLevel { get; }
Property Value
Description
The RestGuild's description, shown in the 'Discovery' tab.
public string? Description { get; }
Property Value
DiscoverySplashHash
The RestGuild's discovery splash hash.
public string? DiscoverySplashHash { get; }
Property Value
Emojis
A dictionary of GuildEmoji objects, indexed by their IDs, representing the RestGuild's custom emojis.
public ImmutableDictionary<ulong, GuildEmoji> Emojis { get; set; }
Property Value
EveryoneRole
The guild's base role, applied to all users.
public Role? EveryoneRole { get; }
Property Value
Features
A list of RestGuild feature strings, representing what features are currently enabled.
public IReadOnlyList<string> Features { get; }
Property Value
HasBanner
Whether the RestGuild has a set banner.
public bool HasBanner { get; }
Property Value
HasDiscoverySplash
Whether the RestGuild has a set discovery splash.
public bool HasDiscoverySplash { get; }
Property Value
HasIcon
Whether the RestGuild has an icon set.
public bool HasIcon { get; }
Property Value
HasSplash
Whether the RestGuild has a set splash.
public bool HasSplash { get; }
Property Value
IconHash
The RestGuild's icon hash.
public string? IconHash { get; }
Property Value
Id
The RestGuild's ID.
public override ulong Id { get; }
Property Value
IsOwner
public virtual bool IsOwner { get; }
Property Value
MaxPresences
The maximum number of Presences for the RestGuild. Always null with the exception of the largest guilds.
public int? MaxPresences { get; }
Property Value
- int?
MaxStageVideoChannelUsers
The maximum amount of users in a stage video channel.
public int? MaxStageVideoChannelUsers { get; }
Property Value
- int?
MaxUsers
public int? MaxUsers { get; }
Property Value
- int?
MaxVideoChannelUsers
The maximum amount of users in a video channel.
public int? MaxVideoChannelUsers { get; }
Property Value
- int?
MfaLevel
The RestGuild's required Multi-Factor Authentication level.
public MfaLevel MfaLevel { get; }
Property Value
Name
The name of the RestGuild. Must be between 2 and 100 characters. Leading and trailing whitespace are trimmed.
public string Name { get; }
Property Value
NsfwLevel
The RestGuild's set NSFW level.
public NsfwLevel NsfwLevel { get; }
Property Value
OwnerId
The ID of the RestGuild's owner.
public ulong OwnerId { get; }
Property Value
Permissions
Total permissions for the user in the RestGuild (excludes overwrites and implicit permissions).
public Permissions? Permissions { get; }
Property Value
Remarks
Only available in objects returned from GetCurrentUserGuildsAsync(GuildsPaginationProperties?, RestRequestProperties?).
PreferredLocale
The preferred locale of a community RestGuild, used for the 'Discovery' tab and in notices from Discord, also sent in interactions. Defaults to en-US
.
public string PreferredLocale { get; }
Property Value
PremiumProgressBarEnabled
Whether the RestGuild has the boost progress bar enabled.
public bool PremiumProgressBarEnabled { get; }
Property Value
PremiumSubscriptionCount
The number of boosts the RestGuild currently has.
public int? PremiumSubscriptionCount { get; }
Property Value
- int?
PremiumTier
The RestGuild's current server boost level.
public int PremiumTier { get; }
Property Value
PublicUpdatesChannelId
The ID of the channel where admins and moderators of community guilds receive notices from Discord.
public ulong? PublicUpdatesChannelId { get; }
Property Value
Roles
public ImmutableDictionary<ulong, Role> Roles { get; set; }
Property Value
RulesChannelId
The ID of the channel where community guilds can display their rules and/or guidelines.
public ulong? RulesChannelId { get; }
Property Value
SafetyAlertsChannelId
The ID of the channel where admins and moderators of community guilds receive safety alerts from Discord.
public ulong? SafetyAlertsChannelId { get; }
Property Value
SplashHash
The RestGuild's splash hash.
public string? SplashHash { get; }
Property Value
Stickers
A dictionary of GuildSticker objects indexed by their IDs, representing the RestGuild's custom stickers.
public ImmutableDictionary<ulong, GuildSticker> Stickers { get; set; }
Property Value
SystemChannelFlags
Represents the RestGuild's current system channels settings.
public SystemChannelFlags SystemChannelFlags { get; }
Property Value
SystemChannelId
The ID of the channel where RestGuild notices such as welcome messages and boost events are posted.
public ulong? SystemChannelId { get; }
Property Value
VanityUrlCode
The RestGuild's vanity invite URL code.
public string? VanityUrlCode { get; }
Property Value
VerificationLevel
The VerificationLevel required for the RestGuild.
public VerificationLevel VerificationLevel { get; }
Property Value
WelcomeScreen
The welcome screen shown to new members, returned in an invite's RestGuild object.
public GuildWelcomeScreen? WelcomeScreen { get; }
Property Value
WidgetChannelId
The ID of the channel that the GuildWidget will generate an invite to, or null if set to no invite.
public ulong? WidgetChannelId { get; }
Property Value
WidgetEnabled
true if the GuildWidget is enabled.
public bool? WidgetEnabled { get; }
Property Value
- bool?
Methods
AddUserAsync(ulong, GuildUserProperties, RestRequestProperties?, CancellationToken)
public Task<GuildUser?> AddUserAsync(ulong userId, GuildUserProperties userProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulonguserProperties
GuildUserPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
AddUserRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)
public Task AddUserRoleAsync(ulong userId, ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongroleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
BanUserAsync(ulong, int, RestRequestProperties?, CancellationToken)
public Task BanUserAsync(ulong userId, int deleteMessageSeconds = 0, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongdeleteMessageSeconds
intproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
BanUsersAsync(IEnumerable<ulong>, int, RestRequestProperties?, CancellationToken)
public Task<GuildBulkBan> BanUsersAsync(IEnumerable<ulong> userIds, int deleteMessageSeconds = 0, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userIds
IEnumerable<ulong>deleteMessageSeconds
intproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
BulkOverwriteApplicationCommandsAsync(ulong, IEnumerable<ApplicationCommandProperties>, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildApplicationCommand>> BulkOverwriteApplicationCommandsAsync(ulong applicationId, IEnumerable<ApplicationCommandProperties> commands, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommands
IEnumerable<ApplicationCommandProperties>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
Compare(PartialGuildUser?, PartialGuildUser?)
public int Compare(PartialGuildUser? x, PartialGuildUser? y)
Parameters
Returns
CreateApplicationCommandAsync(ulong, ApplicationCommandProperties, RestRequestProperties?, CancellationToken)
public Task<GuildApplicationCommand> CreateApplicationCommandAsync(ulong applicationId, ApplicationCommandProperties applicationCommandProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongapplicationCommandProperties
ApplicationCommandPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateAutoModerationRuleAsync(AutoModerationRuleProperties, RestRequestProperties?, CancellationToken)
public Task<AutoModerationRule> CreateAutoModerationRuleAsync(AutoModerationRuleProperties autoModerationRuleProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
autoModerationRuleProperties
AutoModerationRulePropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateChannelAsync(GuildChannelProperties, RestRequestProperties?, CancellationToken)
public Task<IGuildChannel> CreateChannelAsync(GuildChannelProperties channelProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
channelProperties
GuildChannelPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateEmojiAsync(GuildEmojiProperties, RestRequestProperties?, CancellationToken)
public Task<GuildEmoji> CreateEmojiAsync(GuildEmojiProperties guildEmojiProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildEmojiProperties
GuildEmojiPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateRoleAsync(RoleProperties, RestRequestProperties?, CancellationToken)
public Task<Role> CreateRoleAsync(RoleProperties guildRoleProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildRoleProperties
RolePropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateScheduledEventAsync(GuildScheduledEventProperties, RestRequestProperties?, CancellationToken)
public Task<GuildScheduledEvent> CreateScheduledEventAsync(GuildScheduledEventProperties guildScheduledEventProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildScheduledEventProperties
GuildScheduledEventPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateStickerAsync(GuildStickerProperties, RestRequestProperties?, CancellationToken)
public Task<GuildSticker> CreateStickerAsync(GuildStickerProperties sticker, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
sticker
GuildStickerPropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
CreateTemplateAsync(GuildTemplateProperties, RestRequestProperties?, CancellationToken)
public Task<GuildTemplate> CreateTemplateAsync(GuildTemplateProperties guildTemplateProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
guildTemplateProperties
GuildTemplatePropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)
public Task DeleteApplicationCommandAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommandId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteAsync(RestRequestProperties?, CancellationToken)
public Task DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteAutoModerationRuleAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteAutoModerationRuleAsync(ulong autoModerationRuleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
autoModerationRuleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteEmojiAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteEmojiAsync(ulong emojiId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
emojiId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteIntegrationAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteIntegrationAsync(ulong integrationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
integrationId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteRoleAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteRoleAsync(ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
roleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteScheduledEventAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteScheduledEventAsync(ulong scheduledEventId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
scheduledEventId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteStickerAsync(ulong, RestRequestProperties?, CancellationToken)
public Task DeleteStickerAsync(ulong stickerId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
stickerId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
DeleteTemplateAsync(string, RestRequestProperties?, CancellationToken)
public Task<GuildTemplate> DeleteTemplateAsync(string templateCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
templateCode
stringproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
FindUserAsync(string, int, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildUser>> FindUserAsync(string name, int limit, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
name
stringlimit
intproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetActiveThreadsAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildThread>> GetActiveThreadsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)
public Task<GuildApplicationCommand> GetApplicationCommandAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommandId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetApplicationCommandPermissionsAsync(ulong, ulong, RestRequestProperties?, CancellationToken)
public Task<ApplicationCommandGuildPermissions> GetApplicationCommandPermissionsAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommandId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetApplicationCommandsAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildApplicationCommand>> GetApplicationCommandsAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetApplicationCommandsPermissionsAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<ApplicationCommandGuildPermissions>> GetApplicationCommandsPermissionsAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetAsync(bool, RestRequestProperties?, CancellationToken)
public Task<RestGuild> GetAsync(bool withCounts = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
withCounts
boolproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetAuditLogAsync(GuildAuditLogPaginationProperties?, RestRequestProperties?)
public IAsyncEnumerable<RestAuditLogEntry> GetAuditLogAsync(GuildAuditLogPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)
Parameters
paginationProperties
GuildAuditLogPaginationPropertiesproperties
RestRequestProperties
Returns
GetAutoModerationRuleAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<AutoModerationRule> GetAutoModerationRuleAsync(ulong autoModerationRuleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
autoModerationRuleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetAutoModerationRulesAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<AutoModerationRule>> GetAutoModerationRulesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetBanAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<GuildBan> GetBanAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetBannerUrl(ImageFormat?)
public ImageUrl? GetBannerUrl(ImageFormat? format = null)
Parameters
format
ImageFormat?The format of the returned ImageUrl. Defaults to Png (or Gif for animated icons).
Returns
- ImageUrl
An ImageUrl pointing to the guild's banner. If the guild does not have one set, returns null.
GetBansAsync(PaginationProperties<ulong>?, RestRequestProperties?)
public IAsyncEnumerable<GuildBan> GetBansAsync(PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)
Parameters
paginationProperties
PaginationProperties<ulong>properties
RestRequestProperties
Returns
GetChannelsAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<IGuildChannel>> GetChannelsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetCurrentUserGuildUserAsync(RestRequestProperties?, CancellationToken)
public Task<GuildUser> GetCurrentUserGuildUserAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetCurrentUserVoiceStateAsync(RestRequestProperties?, CancellationToken)
public Task<VoiceState> GetCurrentUserVoiceStateAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetDiscoverySplashUrl(ImageFormat)
public ImageUrl? GetDiscoverySplashUrl(ImageFormat format)
Parameters
format
ImageFormatThe format of the returned ImageUrl.
Returns
- ImageUrl
An ImageUrl pointing to the guild's discovery splash. If the guild does not have one set, returns null.
GetEmojiAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<GuildEmoji> GetEmojiAsync(ulong emojiId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
emojiId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetEmojisAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildEmoji>> GetEmojisAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetIconUrl(ImageFormat?)
public ImageUrl? GetIconUrl(ImageFormat? format = null)
Parameters
format
ImageFormat?The format of the returned ImageUrl. Defaults to Png (or Gif for animated icons).
Returns
- ImageUrl
An ImageUrl pointing to the guild's icon. If the guild does not have one set, returns null.
GetIntegrationsAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<Integration>> GetIntegrationsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetInvitesAsync(RestRequestProperties?, CancellationToken)
public Task<IEnumerable<RestInvite>> GetInvitesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetOnboardingAsync(RestRequestProperties?, CancellationToken)
public Task<GuildOnboarding> GetOnboardingAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetPreviewAsync(RestRequestProperties?, CancellationToken)
public Task<GuildPreview> GetPreviewAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetPruneCountAsync(int, IEnumerable<ulong>?, RestRequestProperties?, CancellationToken)
public Task<int> GetPruneCountAsync(int days, IEnumerable<ulong>? roles = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
days
introles
IEnumerable<ulong>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetRoleAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<Role> GetRoleAsync(ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
roleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetRolesAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<Role>> GetRolesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetScheduledEventAsync(ulong, bool, RestRequestProperties?, CancellationToken)
public Task<GuildScheduledEvent> GetScheduledEventAsync(ulong scheduledEventId, bool withUserCount = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
scheduledEventId
ulongwithUserCount
boolproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetScheduledEventUsersAsync(ulong, OptionalGuildUsersPaginationProperties?, RestRequestProperties?)
public IAsyncEnumerable<GuildScheduledEventUser> GetScheduledEventUsersAsync(ulong scheduledEventId, OptionalGuildUsersPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)
Parameters
scheduledEventId
ulongpaginationProperties
OptionalGuildUsersPaginationPropertiesproperties
RestRequestProperties
Returns
GetScheduledEventsAsync(bool, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildScheduledEvent>> GetScheduledEventsAsync(bool withUserCount = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
withUserCount
boolproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetSplashUrl(ImageFormat)
public ImageUrl? GetSplashUrl(ImageFormat format)
Parameters
format
ImageFormatThe format of the returned ImageUrl.
Returns
- ImageUrl
An ImageUrl pointing to the guild's splash. If the guild does not have one set, returns null.
GetStickerAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<GuildSticker> GetStickerAsync(ulong stickerId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
stickerId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetStickersAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<GuildSticker>> GetStickersAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetTemplatesAsync(RestRequestProperties?, CancellationToken)
public Task<IEnumerable<GuildTemplate>> GetTemplatesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetUserAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<GuildUser> GetUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetUserVoiceStateAsync(ulong, RestRequestProperties?, CancellationToken)
public Task<VoiceState> GetUserVoiceStateAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetUsersAsync(PaginationProperties<ulong>?, RestRequestProperties?)
public IAsyncEnumerable<GuildUser> GetUsersAsync(PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)
Parameters
paginationProperties
PaginationProperties<ulong>properties
RestRequestProperties
Returns
GetVanityInviteAsync(RestRequestProperties?, CancellationToken)
public Task<GuildVanityInvite> GetVanityInviteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetVoiceRegionsAsync(RestRequestProperties?, CancellationToken)
public Task<IEnumerable<VoiceRegion>> GetVoiceRegionsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetWebhooksAsync(RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<Webhook>> GetWebhooksAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetWelcomeScreenAsync(RestRequestProperties?, CancellationToken)
public Task<GuildWelcomeScreen> GetWelcomeScreenAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetWidgetAsync(RestRequestProperties?, CancellationToken)
public Task<GuildWidget> GetWidgetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetWidgetSettingsAsync(RestRequestProperties?, CancellationToken)
public Task<GuildWidgetSettings> GetWidgetSettingsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
GetWidgetUrl(GuildWidgetStyle?, string?, ApiVersion?)
public ImageUrl GetWidgetUrl(GuildWidgetStyle? style = null, string? hostname = null, ApiVersion? version = null)
Parameters
style
GuildWidgetStyle?hostname
stringversion
ApiVersion?
Returns
KickUserAsync(ulong, RestRequestProperties?, CancellationToken)
public Task KickUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
LeaveAsync(RestRequestProperties?, CancellationToken)
public Task LeaveAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyApplicationCommandAsync(ulong, ulong, Action<ApplicationCommandOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildApplicationCommand> ModifyApplicationCommandAsync(ulong applicationId, ulong commandId, Action<ApplicationCommandOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommandId
ulongaction
Action<ApplicationCommandOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyAsync(Action<GuildOptions>, RestRequestProperties?, CancellationToken)
public Task<RestGuild> ModifyAsync(Action<GuildOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<GuildOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyAutoModerationRuleAsync(ulong, Action<AutoModerationRuleOptions>, RestRequestProperties?, CancellationToken)
public Task<AutoModerationRule> ModifyAutoModerationRuleAsync(ulong autoModerationRuleId, Action<AutoModerationRuleOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
autoModerationRuleId
ulongaction
Action<AutoModerationRuleOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyChannelPositionsAsync(IEnumerable<GuildChannelPositionProperties>, RestRequestProperties?, CancellationToken)
public Task ModifyChannelPositionsAsync(IEnumerable<GuildChannelPositionProperties> positions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
positions
IEnumerable<GuildChannelPositionProperties>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyCurrentUserAsync(Action<CurrentGuildUserOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildUser> ModifyCurrentUserAsync(Action<CurrentGuildUserOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<CurrentGuildUserOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyCurrentUserVoiceStateAsync(Action<CurrentUserVoiceStateOptions>, RestRequestProperties?, CancellationToken)
public Task ModifyCurrentUserVoiceStateAsync(Action<CurrentUserVoiceStateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<CurrentUserVoiceStateOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyEmojiAsync(ulong, Action<GuildEmojiOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildEmoji> ModifyEmojiAsync(ulong emojiId, Action<GuildEmojiOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
emojiId
ulongaction
Action<GuildEmojiOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyMfaLevelAsync(MfaLevel, RestRequestProperties?, CancellationToken)
public Task<MfaLevel> ModifyMfaLevelAsync(MfaLevel mfaLevel, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
mfaLevel
MfaLevelproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyOnboardingAsync(Action<GuildOnboardingOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildOnboarding> ModifyOnboardingAsync(Action<GuildOnboardingOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<GuildOnboardingOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyRoleAsync(ulong, Action<RoleOptions>, RestRequestProperties?, CancellationToken)
public Task<Role> ModifyRoleAsync(ulong roleId, Action<RoleOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
roleId
ulongaction
Action<RoleOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyRolePositionsAsync(IEnumerable<RolePositionProperties>, RestRequestProperties?, CancellationToken)
public Task<IReadOnlyList<Role>> ModifyRolePositionsAsync(IEnumerable<RolePositionProperties> positions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
positions
IEnumerable<RolePositionProperties>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyScheduledEventAsync(ulong, Action<GuildScheduledEventOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildScheduledEvent> ModifyScheduledEventAsync(ulong scheduledEventId, Action<GuildScheduledEventOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
scheduledEventId
ulongaction
Action<GuildScheduledEventOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyStickerAsync(ulong, Action<GuildStickerOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildSticker> ModifyStickerAsync(ulong stickerId, Action<GuildStickerOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
stickerId
ulongaction
Action<GuildStickerOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyTemplateAsync(string, Action<GuildTemplateOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildTemplate> ModifyTemplateAsync(string templateCode, Action<GuildTemplateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
templateCode
stringaction
Action<GuildTemplateOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyUserAsync(ulong, Action<GuildUserOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildUser> ModifyUserAsync(ulong userId, Action<GuildUserOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongaction
Action<GuildUserOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyUserVoiceStateAsync(ulong, ulong, Action<VoiceStateOptions>, RestRequestProperties?, CancellationToken)
public Task ModifyUserVoiceStateAsync(ulong channelId, ulong userId, Action<VoiceStateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
channelId
ulonguserId
ulongaction
Action<VoiceStateOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyWelcomeScreenAsync(Action<GuildWelcomeScreenOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildWelcomeScreen> ModifyWelcomeScreenAsync(Action<GuildWelcomeScreenOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<GuildWelcomeScreenOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
ModifyWidgetSettingsAsync(Action<GuildWidgetSettingsOptions>, RestRequestProperties?, CancellationToken)
public Task<GuildWidgetSettings> ModifyWidgetSettingsAsync(Action<GuildWidgetSettingsOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
action
Action<GuildWidgetSettingsOptions>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
OverwriteApplicationCommandPermissionsAsync(ulong, ulong, IEnumerable<ApplicationCommandGuildPermissionProperties>, RestRequestProperties?, CancellationToken)
public Task<ApplicationCommandGuildPermissions> OverwriteApplicationCommandPermissionsAsync(ulong applicationId, ulong commandId, IEnumerable<ApplicationCommandGuildPermissionProperties> newPermissions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
applicationId
ulongcommandId
ulongnewPermissions
IEnumerable<ApplicationCommandGuildPermissionProperties>properties
RestRequestPropertiescancellationToken
CancellationToken
Returns
PruneAsync(GuildPruneProperties, RestRequestProperties?, CancellationToken)
public Task<int?> PruneAsync(GuildPruneProperties pruneProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
pruneProperties
GuildPrunePropertiesproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
RemoveUserRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)
public Task RemoveUserRoleAsync(ulong userId, ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongroleId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
SearchUsersAsync(GuildUsersSearchPaginationProperties?, RestRequestProperties?)
public IAsyncEnumerable<GuildUserInfo> SearchUsersAsync(GuildUsersSearchPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)
Parameters
paginationProperties
GuildUsersSearchPaginationPropertiesproperties
RestRequestProperties
Returns
SyncTemplateAsync(string, RestRequestProperties?, CancellationToken)
public Task<GuildTemplate> SyncTemplateAsync(string templateCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
templateCode
stringproperties
RestRequestPropertiescancellationToken
CancellationToken
Returns
UnbanUserAsync(ulong, RestRequestProperties?, CancellationToken)
public Task UnbanUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
userId
ulongproperties
RestRequestPropertiescancellationToken
CancellationToken