Table of Contents

Class RestGuild

Namespace
NetCord.Rest
Assembly
NetCord.dll

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 JsonGuild
client RestClient

Properties

AfkChannelId

ID of the RestGuild's AFK channel.

public ulong? AfkChannelId { get; }

Property Value

ulong?

AfkTimeout

How long in seconds to wait before moving users to the AFK channel.

public int AfkTimeout { get; }

Property Value

int

ApplicationId

The RestGuild creator's application ID, if it was created by a bot.

public ulong? ApplicationId { get; }

Property Value

ulong?

ApproximatePresenceCount

Approximate number of non-offline GuildUsers in the RestGuild.

public int? ApproximatePresenceCount { get; }

Property Value

int?

Remarks

ApproximateUserCount

The approximate number of GuildUsers in the RestGuild.

public int? ApproximateUserCount { get; }

Property Value

int?

Remarks

BannerHash

The RestGuild's banner hash.

public string? BannerHash { get; }

Property Value

string

ContentFilter

public ContentFilter ContentFilter { get; }

Property Value

ContentFilter

DefaultMessageNotificationLevel

public DefaultMessageNotificationLevel DefaultMessageNotificationLevel { get; }

Property Value

DefaultMessageNotificationLevel

Description

The RestGuild's description, shown in the 'Discovery' tab.

public string? Description { get; }

Property Value

string

DiscoverySplashHash

The RestGuild's discovery splash hash.

public string? DiscoverySplashHash { get; }

Property Value

string

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

ImmutableDictionary<ulong, GuildEmoji>

EveryoneRole

The guild's base role, applied to all users.

public Role? EveryoneRole { get; }

Property Value

Role

The guild's base role, applied to all users or null if the guild is partial.

Features

A list of RestGuild feature strings, representing what features are currently enabled.

public IReadOnlyList<string> Features { get; }

Property Value

IReadOnlyList<string>

HasBanner

Whether the RestGuild has a set banner.

public bool HasBanner { get; }

Property Value

bool

HasDiscoverySplash

Whether the RestGuild has a set discovery splash.

public bool HasDiscoverySplash { get; }

Property Value

bool

HasIcon

Whether the RestGuild has an icon set.

public bool HasIcon { get; }

Property Value

bool

HasSplash

Whether the RestGuild has a set splash.

public bool HasSplash { get; }

Property Value

bool

IconHash

The RestGuild's icon hash.

public string? IconHash { get; }

Property Value

string

Id

The RestGuild's ID.

public override ulong Id { get; }

Property Value

ulong

IsOwner

true if the user is the owner of the RestGuild.

public virtual bool IsOwner { get; }

Property Value

bool

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

The maximum number of GuildUsers for the RestGuild.

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

MfaLevel

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

string

NsfwLevel

The RestGuild's set NSFW level.

public NsfwLevel NsfwLevel { get; }

Property Value

NsfwLevel

OwnerId

The ID of the RestGuild's owner.

public ulong OwnerId { get; }

Property Value

ulong

Permissions

Total permissions for the user in the RestGuild (excludes overwrites and implicit permissions).

public Permissions? Permissions { get; }

Property Value

Permissions?

Remarks

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

string

PremiumProgressBarEnabled

Whether the RestGuild has the boost progress bar enabled.

public bool PremiumProgressBarEnabled { get; }

Property Value

bool

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

int

PublicUpdatesChannelId

The ID of the channel where admins and moderators of community guilds receive notices from Discord.

public ulong? PublicUpdatesChannelId { get; }

Property Value

ulong?

Roles

A dictionary of Role objects indexed by their IDs, representing the RestGuild's roles.

public ImmutableDictionary<ulong, Role> Roles { get; set; }

Property Value

ImmutableDictionary<ulong, Role>

RulesChannelId

The ID of the channel where community guilds can display their rules and/or guidelines.

public ulong? RulesChannelId { get; }

Property Value

ulong?

SafetyAlertsChannelId

The ID of the channel where admins and moderators of community guilds receive safety alerts from Discord.

public ulong? SafetyAlertsChannelId { get; }

Property Value

ulong?

SplashHash

The RestGuild's splash hash.

public string? SplashHash { get; }

Property Value

string

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

ImmutableDictionary<ulong, GuildSticker>

SystemChannelFlags

Represents the RestGuild's current system channels settings.

public SystemChannelFlags SystemChannelFlags { get; }

Property Value

SystemChannelFlags

SystemChannelId

The ID of the channel where RestGuild notices such as welcome messages and boost events are posted.

public ulong? SystemChannelId { get; }

Property Value

ulong?

VanityUrlCode

The RestGuild's vanity invite URL code.

public string? VanityUrlCode { get; }

Property Value

string

VerificationLevel

The VerificationLevel required for the RestGuild.

public VerificationLevel VerificationLevel { get; }

Property Value

VerificationLevel

WelcomeScreen

The welcome screen shown to new members, returned in an invite's RestGuild object.

public GuildWelcomeScreen? WelcomeScreen { get; }

Property Value

GuildWelcomeScreen

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

ulong?

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 ulong
userProperties GuildUserProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

AddUserRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task AddUserRoleAsync(ulong userId, ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

BanUserAsync(ulong, int, RestRequestProperties?, CancellationToken)

public Task BanUserAsync(ulong userId, int deleteMessageSeconds = 0, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
deleteMessageSeconds int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

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 int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildBulkBan>

BulkOverwriteApplicationCommandsAsync(ulong, IEnumerable<ApplicationCommandProperties>, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildApplicationCommand>> BulkOverwriteApplicationCommandsAsync(ulong applicationId, IEnumerable<ApplicationCommandProperties> commands, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
commands IEnumerable<ApplicationCommandProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildApplicationCommand>>

Compare(PartialGuildUser?, PartialGuildUser?)

public int Compare(PartialGuildUser? x, PartialGuildUser? y)

Parameters

x PartialGuildUser
y PartialGuildUser

Returns

int

CreateApplicationCommandAsync(ulong, ApplicationCommandProperties, RestRequestProperties?, CancellationToken)

public Task<GuildApplicationCommand> CreateApplicationCommandAsync(ulong applicationId, ApplicationCommandProperties applicationCommandProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
applicationCommandProperties ApplicationCommandProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

CreateAutoModerationRuleAsync(AutoModerationRuleProperties, RestRequestProperties?, CancellationToken)

public Task<AutoModerationRule> CreateAutoModerationRuleAsync(AutoModerationRuleProperties autoModerationRuleProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

autoModerationRuleProperties AutoModerationRuleProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<AutoModerationRule>

CreateChannelAsync(GuildChannelProperties, RestRequestProperties?, CancellationToken)

public Task<IGuildChannel> CreateChannelAsync(GuildChannelProperties channelProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelProperties GuildChannelProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IGuildChannel>

CreateEmojiAsync(GuildEmojiProperties, RestRequestProperties?, CancellationToken)

public Task<GuildEmoji> CreateEmojiAsync(GuildEmojiProperties guildEmojiProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildEmojiProperties GuildEmojiProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

CreateRoleAsync(RoleProperties, RestRequestProperties?, CancellationToken)

public Task<Role> CreateRoleAsync(RoleProperties guildRoleProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildRoleProperties RoleProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

CreateScheduledEventAsync(GuildScheduledEventProperties, RestRequestProperties?, CancellationToken)

public Task<GuildScheduledEvent> CreateScheduledEventAsync(GuildScheduledEventProperties guildScheduledEventProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildScheduledEventProperties GuildScheduledEventProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

CreateStickerAsync(GuildStickerProperties, RestRequestProperties?, CancellationToken)

public Task<GuildSticker> CreateStickerAsync(GuildStickerProperties sticker, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

sticker GuildStickerProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

CreateTemplateAsync(GuildTemplateProperties, RestRequestProperties?, CancellationToken)

public Task<GuildTemplate> CreateTemplateAsync(GuildTemplateProperties guildTemplateProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildTemplateProperties GuildTemplateProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

DeleteApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task DeleteApplicationCommandAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteAsync(RestRequestProperties?, CancellationToken)

public Task DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteAutoModerationRuleAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteAutoModerationRuleAsync(ulong autoModerationRuleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

autoModerationRuleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteEmojiAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteEmojiAsync(ulong emojiId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

emojiId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteIntegrationAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteIntegrationAsync(ulong integrationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

integrationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteRoleAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteRoleAsync(ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteScheduledEventAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteScheduledEventAsync(ulong scheduledEventId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

scheduledEventId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteStickerAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteStickerAsync(ulong stickerId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

stickerId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteTemplateAsync(string, RestRequestProperties?, CancellationToken)

public Task<GuildTemplate> DeleteTemplateAsync(string templateCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

templateCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

FindUserAsync(string, int, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildUser>> FindUserAsync(string name, int limit, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

name string
limit int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildUser>>

GetActiveThreadsAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildThread>> GetActiveThreadsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildThread>>

GetApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<GuildApplicationCommand> GetApplicationCommandAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

GetApplicationCommandPermissionsAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<ApplicationCommandGuildPermissions> GetApplicationCommandPermissionsAsync(ulong applicationId, ulong commandId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

GetApplicationCommandsAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildApplicationCommand>> GetApplicationCommandsAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildApplicationCommand>>

GetApplicationCommandsPermissionsAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<ApplicationCommandGuildPermissions>> GetApplicationCommandsPermissionsAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ApplicationCommandGuildPermissions>>

GetAsync(bool, RestRequestProperties?, CancellationToken)

public Task<RestGuild> GetAsync(bool withCounts = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

withCounts bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

GetAuditLogAsync(GuildAuditLogPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<RestAuditLogEntry> GetAuditLogAsync(GuildAuditLogPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

paginationProperties GuildAuditLogPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<RestAuditLogEntry>

GetAutoModerationRuleAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<AutoModerationRule> GetAutoModerationRuleAsync(ulong autoModerationRuleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

autoModerationRuleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<AutoModerationRule>

GetAutoModerationRulesAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<AutoModerationRule>> GetAutoModerationRulesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<AutoModerationRule>>

GetBanAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<GuildBan> GetBanAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildBan>

GetBannerUrl(ImageFormat?)

Gets the ImageUrl of the RestGuild's banner.

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

IAsyncEnumerable<GuildBan>

GetChannelsAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<IGuildChannel>> GetChannelsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<IGuildChannel>>

GetCurrentUserGuildUserAsync(RestRequestProperties?, CancellationToken)

public Task<GuildUser> GetCurrentUserGuildUserAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

GetCurrentUserVoiceStateAsync(RestRequestProperties?, CancellationToken)

public Task<VoiceState> GetCurrentUserVoiceStateAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<VoiceState>

GetDiscoverySplashUrl(ImageFormat)

Gets the ImageUrl of the RestGuild's discovery splash.

public ImageUrl? GetDiscoverySplashUrl(ImageFormat format)

Parameters

format ImageFormat

The 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 ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

GetEmojisAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildEmoji>> GetEmojisAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildEmoji>>

GetIconUrl(ImageFormat?)

Gets the ImageUrl of the RestGuild's icon.

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 RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Integration>>

GetInvitesAsync(RestRequestProperties?, CancellationToken)

public Task<IEnumerable<RestInvite>> GetInvitesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<RestInvite>>

GetOnboardingAsync(RestRequestProperties?, CancellationToken)

public Task<GuildOnboarding> GetOnboardingAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildOnboarding>

GetPreviewAsync(RestRequestProperties?, CancellationToken)

public Task<GuildPreview> GetPreviewAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildPreview>

GetPruneCountAsync(int, IEnumerable<ulong>?, RestRequestProperties?, CancellationToken)

public Task<int> GetPruneCountAsync(int days, IEnumerable<ulong>? roles = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

days int
roles IEnumerable<ulong>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<int>

GetRoleAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<Role> GetRoleAsync(ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

GetRolesAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<Role>> GetRolesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Role>>

GetScheduledEventAsync(ulong, bool, RestRequestProperties?, CancellationToken)

public Task<GuildScheduledEvent> GetScheduledEventAsync(ulong scheduledEventId, bool withUserCount = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

scheduledEventId ulong
withUserCount bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

GetScheduledEventUsersAsync(ulong, OptionalGuildUsersPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<GuildScheduledEventUser> GetScheduledEventUsersAsync(ulong scheduledEventId, OptionalGuildUsersPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

scheduledEventId ulong
paginationProperties OptionalGuildUsersPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildScheduledEventUser>

GetScheduledEventsAsync(bool, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildScheduledEvent>> GetScheduledEventsAsync(bool withUserCount = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

withUserCount bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildScheduledEvent>>

GetSplashUrl(ImageFormat)

Gets the ImageUrl of the RestGuild's splash.

public ImageUrl? GetSplashUrl(ImageFormat format)

Parameters

format ImageFormat

The 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 ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

GetStickersAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GuildSticker>> GetStickersAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildSticker>>

GetTemplatesAsync(RestRequestProperties?, CancellationToken)

public Task<IEnumerable<GuildTemplate>> GetTemplatesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<GuildTemplate>>

GetUserAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<GuildUser> GetUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

GetUserVoiceStateAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<VoiceState> GetUserVoiceStateAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<VoiceState>

GetUsersAsync(PaginationProperties<ulong>?, RestRequestProperties?)

public IAsyncEnumerable<GuildUser> GetUsersAsync(PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

paginationProperties PaginationProperties<ulong>
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildUser>

GetVanityInviteAsync(RestRequestProperties?, CancellationToken)

public Task<GuildVanityInvite> GetVanityInviteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildVanityInvite>

GetVoiceRegionsAsync(RestRequestProperties?, CancellationToken)

public Task<IEnumerable<VoiceRegion>> GetVoiceRegionsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<VoiceRegion>>

GetWebhooksAsync(RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<Webhook>> GetWebhooksAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Webhook>>

GetWelcomeScreenAsync(RestRequestProperties?, CancellationToken)

public Task<GuildWelcomeScreen> GetWelcomeScreenAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWelcomeScreen>

GetWidgetAsync(RestRequestProperties?, CancellationToken)

public Task<GuildWidget> GetWidgetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidget>

GetWidgetSettingsAsync(RestRequestProperties?, CancellationToken)

public Task<GuildWidgetSettings> GetWidgetSettingsAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidgetSettings>

GetWidgetUrl(GuildWidgetStyle?, string?, ApiVersion?)

public ImageUrl GetWidgetUrl(GuildWidgetStyle? style = null, string? hostname = null, ApiVersion? version = null)

Parameters

style GuildWidgetStyle?
hostname string
version ApiVersion?

Returns

ImageUrl

KickUserAsync(ulong, RestRequestProperties?, CancellationToken)

public Task KickUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

LeaveAsync(RestRequestProperties?, CancellationToken)

public Task LeaveAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

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 ulong
commandId ulong
action Action<ApplicationCommandOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

ModifyAsync(Action<GuildOptions>, RestRequestProperties?, CancellationToken)

public Task<RestGuild> ModifyAsync(Action<GuildOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<GuildOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

ModifyAutoModerationRuleAsync(ulong, Action<AutoModerationRuleOptions>, RestRequestProperties?, CancellationToken)

public Task<AutoModerationRule> ModifyAutoModerationRuleAsync(ulong autoModerationRuleId, Action<AutoModerationRuleOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

autoModerationRuleId ulong
action Action<AutoModerationRuleOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<AutoModerationRule>

ModifyChannelPositionsAsync(IEnumerable<GuildChannelPositionProperties>, RestRequestProperties?, CancellationToken)

public Task ModifyChannelPositionsAsync(IEnumerable<GuildChannelPositionProperties> positions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

positions IEnumerable<GuildChannelPositionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

ModifyCurrentUserAsync(Action<CurrentGuildUserOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildUser> ModifyCurrentUserAsync(Action<CurrentGuildUserOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<CurrentGuildUserOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

ModifyCurrentUserVoiceStateAsync(Action<CurrentUserVoiceStateOptions>, RestRequestProperties?, CancellationToken)

public Task ModifyCurrentUserVoiceStateAsync(Action<CurrentUserVoiceStateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<CurrentUserVoiceStateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

ModifyEmojiAsync(ulong, Action<GuildEmojiOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildEmoji> ModifyEmojiAsync(ulong emojiId, Action<GuildEmojiOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

emojiId ulong
action Action<GuildEmojiOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

ModifyMfaLevelAsync(MfaLevel, RestRequestProperties?, CancellationToken)

public Task<MfaLevel> ModifyMfaLevelAsync(MfaLevel mfaLevel, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

mfaLevel MfaLevel
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<MfaLevel>

ModifyOnboardingAsync(Action<GuildOnboardingOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildOnboarding> ModifyOnboardingAsync(Action<GuildOnboardingOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<GuildOnboardingOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildOnboarding>

ModifyRoleAsync(ulong, Action<RoleOptions>, RestRequestProperties?, CancellationToken)

public Task<Role> ModifyRoleAsync(ulong roleId, Action<RoleOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

roleId ulong
action Action<RoleOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

ModifyRolePositionsAsync(IEnumerable<RolePositionProperties>, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<Role>> ModifyRolePositionsAsync(IEnumerable<RolePositionProperties> positions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

positions IEnumerable<RolePositionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Role>>

ModifyScheduledEventAsync(ulong, Action<GuildScheduledEventOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildScheduledEvent> ModifyScheduledEventAsync(ulong scheduledEventId, Action<GuildScheduledEventOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

scheduledEventId ulong
action Action<GuildScheduledEventOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

ModifyStickerAsync(ulong, Action<GuildStickerOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildSticker> ModifyStickerAsync(ulong stickerId, Action<GuildStickerOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

stickerId ulong
action Action<GuildStickerOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

ModifyTemplateAsync(string, Action<GuildTemplateOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildTemplate> ModifyTemplateAsync(string templateCode, Action<GuildTemplateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

templateCode string
action Action<GuildTemplateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

ModifyUserAsync(ulong, Action<GuildUserOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildUser> ModifyUserAsync(ulong userId, Action<GuildUserOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
action Action<GuildUserOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

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 ulong
userId ulong
action Action<VoiceStateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

ModifyWelcomeScreenAsync(Action<GuildWelcomeScreenOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildWelcomeScreen> ModifyWelcomeScreenAsync(Action<GuildWelcomeScreenOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<GuildWelcomeScreenOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWelcomeScreen>

ModifyWidgetSettingsAsync(Action<GuildWidgetSettingsOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildWidgetSettings> ModifyWidgetSettingsAsync(Action<GuildWidgetSettingsOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<GuildWidgetSettingsOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidgetSettings>

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 ulong
commandId ulong
newPermissions IEnumerable<ApplicationCommandGuildPermissionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

PruneAsync(GuildPruneProperties, RestRequestProperties?, CancellationToken)

public Task<int?> PruneAsync(GuildPruneProperties pruneProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

pruneProperties GuildPruneProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<int?>

RemoveUserRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task RemoveUserRoleAsync(ulong userId, ulong roleId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

SearchUsersAsync(GuildUsersSearchPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<GuildUserInfo> SearchUsersAsync(GuildUsersSearchPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

paginationProperties GuildUsersSearchPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildUserInfo>

SyncTemplateAsync(string, RestRequestProperties?, CancellationToken)

public Task<GuildTemplate> SyncTemplateAsync(string templateCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

templateCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

UnbanUserAsync(ulong, RestRequestProperties?, CancellationToken)

public Task UnbanUserAsync(ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task