Table of Contents

Interface IGuild

Namespace
Discord
Assembly
Discord.Net.Core.dll

Represents a generic guild/server.

public interface IGuild : IDeletable, ISnowflakeEntity, IEntity<ulong>
Inherited Members
Extension Methods

Properties

AFKChannelId

Gets the ID of the AFK voice channel for this guild.

ulong? AFKChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the AFK voice channel; null if none is set.

AFKTimeout

Gets the amount of time (in seconds) a user must be inactive in a voice channel for until they are automatically moved to the AFK voice channel.

int AFKTimeout { get; }

Property Value

int

An int representing the amount of time in seconds for a user to be marked as inactive and moved into the AFK voice channel.

ApplicationId

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

ulong? ApplicationId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the application ID that created this guild, or null if it was not bot-created.

ApproximateMemberCount

Gets the approximate number of members in this guild.

int? ApproximateMemberCount { get; }

Property Value

int?

The approximate number of members in this guild.

Remarks

Only available when getting a guild via REST when with_counts is true.

ApproximatePresenceCount

Gets the approximate number of non-offline members in this guild.

int? ApproximatePresenceCount { get; }

Property Value

int?

The approximate number of non-offline members in this guild.

Remarks

Only available when getting a guild via REST when with_counts is true.

AudioClient

Gets the IAudioClient currently associated with this guild.

IAudioClient AudioClient { get; }

Property Value

IAudioClient

An IAudioClient currently associated with this guild.

Available

Determines if this guild is currently connected and ready to be used.

bool Available { get; }

Property Value

bool

true if this guild is currently connected and ready to be used; otherwise false.

Remarks

note

This property only applies to a WebSocket-based client.

This boolean is used to determine if the guild is currently connected to the WebSocket and is ready to be used/accessed.

BannerId

Gets the identifier for this guilds banner image.

string BannerId { get; }

Property Value

string

An identifier for the banner image; null if none is set.

BannerUrl

Gets the URL of this guild's banner image.

string BannerUrl { get; }

Property Value

string

A URL pointing to the guild's banner image; null if none is set.

DefaultMessageNotifications

Gets the default message notifications for users who haven't explicitly set their notification settings.

DefaultMessageNotifications DefaultMessageNotifications { get; }

Property Value

DefaultMessageNotifications

Description

Gets the description for the guild.

string Description { get; }

Property Value

string

The description for the guild; null if none is set.

DiscoverySplashId

Gets the ID of this guild's discovery splash image.

string DiscoverySplashId { get; }

Property Value

string

An identifier for the discovery splash image; null if none is set.

DiscoverySplashUrl

Gets the URL of this guild's discovery splash image.

string DiscoverySplashUrl { get; }

Property Value

string

A URL pointing to the guild's discovery splash image; null if none is set.

Emotes

Gets a collection of all custom emotes for this guild.

IReadOnlyCollection<GuildEmote> Emotes { get; }

Property Value

IReadOnlyCollection<GuildEmote>

A read-only collection of all custom emotes for this guild.

EveryoneRole

Gets the built-in role containing all users in this guild.

IRole EveryoneRole { get; }

Property Value

IRole

A role object that represents an @everyone role in this guild.

ExplicitContentFilter

Gets the level of content filtering applied to user's content in a Guild.

ExplicitContentFilterLevel ExplicitContentFilter { get; }

Property Value

ExplicitContentFilterLevel

The level of explicit content filtering.

Features

Gets the features for this guild.

GuildFeatures Features { get; }

Property Value

GuildFeatures

A flags enum containing all the features for the guild.

IconId

Gets the ID of this guild's icon.

string IconId { get; }

Property Value

string

An identifier for the splash image; null if none is set.

IconUrl

Gets the URL of this guild's icon.

string IconUrl { get; }

Property Value

string

A URL pointing to the guild's icon; null if none is set.

IncidentsData

Gets the incidents data for this guild.

GuildIncidentsData IncidentsData { get; }

Property Value

GuildIncidentsData

InventorySettings

Get the inventory settings on the guild. null if not available in the guild.

GuildInventorySettings? InventorySettings { get; }

Property Value

GuildInventorySettings?

IsBoostProgressBarEnabled

Gets whether the guild has the boost progress bar enabled.

bool IsBoostProgressBarEnabled { get; }

Property Value

bool

true if the boost progress bar is enabled; otherwise false.

IsWidgetEnabled

Gets a value that indicates whether this guild has the widget enabled.

bool IsWidgetEnabled { get; }

Property Value

bool

true if this guild has a widget enabled; otherwise false.

MaxBitrate

Gets the max bitrate for voice channels in this guild.

int MaxBitrate { get; }

Property Value

int

A int representing the maximum bitrate value allowed by Discord in this guild.

MaxMembers

Gets the maximum number of members for the guild.

int? MaxMembers { get; }

Property Value

int?

The maximum number of members for the guild.

MaxPresences

Gets the maximum number of presences for the guild.

int? MaxPresences { get; }

Property Value

int?

The maximum number of presences for the guild.

MaxStageVideoChannelUsers

Gets the maximum amount of users in a stage video channel.

int? MaxStageVideoChannelUsers { get; }

Property Value

int?

The maximum amount of users in a stage video channel.

MaxUploadLimit

Gets the upload limit in bytes for this guild. This number is dependent on the guild's boost status.

ulong MaxUploadLimit { get; }

Property Value

ulong

MaxVideoChannelUsers

Gets the maximum amount of users in a video channel.

int? MaxVideoChannelUsers { get; }

Property Value

int?

The maximum amount of users in a video channel.

MfaLevel

Gets the level of Multi-Factor Authentication requirements a user must fulfill before being allowed to perform administrative actions in this guild.

MfaLevel MfaLevel { get; }

Property Value

MfaLevel

The level of MFA requirement.

Name

Gets the name of this guild.

string Name { get; }

Property Value

string

A string containing the name of this guild.

NsfwLevel

Gets the NSFW level of this guild.

NsfwLevel NsfwLevel { get; }

Property Value

NsfwLevel

The NSFW level of this guild.

OwnerId

Gets the ID of the user that owns this guild.

ulong OwnerId { get; }

Property Value

ulong

A ulong representing the snowflake identifier of the user that owns this guild.

PreferredCulture

Gets the preferred culture of this guild.

CultureInfo PreferredCulture { get; }

Property Value

CultureInfo

The preferred culture information of this guild.

PreferredLocale

Gets the preferred locale of this guild in IETF BCP 47 language tag format.

string PreferredLocale { get; }

Property Value

string

The preferred locale of the guild in IETF BCP 47 language tag format.

PremiumSubscriptionCount

Gets the number of premium subscribers of this guild.

int PremiumSubscriptionCount { get; }

Property Value

int

The number of premium subscribers of this guild.

Remarks

This is the number of users who have boosted this guild.

PremiumTier

Gets the tier of guild boosting in this guild.

PremiumTier PremiumTier { get; }

Property Value

PremiumTier

The tier of guild boosting in this guild.

PublicUpdatesChannelId

Gets the ID of the channel where admins and moderators of Community guilds receive notices from Discord.

ulong? PublicUpdatesChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the channel where admins and moderators of Community guilds receive notices from Discord; null if none is set.

Roles

Gets a collection of all roles in this guild.

IReadOnlyCollection<IRole> Roles { get; }

Property Value

IReadOnlyCollection<IRole>

A read-only collection of roles found within this guild.

RulesChannelId

Gets the ID of the channel with the rules.

ulong? RulesChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the channel that contains the rules; null if none is set.

SafetyAlertsChannelId

Gets the ID of the channel assigned to the safety alerts channel of this guild.

ulong? SafetyAlertsChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the safety alerts channel; null if none is set.

SplashId

Gets the ID of this guild's splash image.

string SplashId { get; }

Property Value

string

An identifier for the splash image; null if none is set.

SplashUrl

Gets the URL of this guild's splash image.

string SplashUrl { get; }

Property Value

string

A URL pointing to the guild's splash image; null if none is set.

Stickers

Gets a collection of all custom stickers for this guild.

IReadOnlyCollection<ICustomSticker> Stickers { get; }

Property Value

IReadOnlyCollection<ICustomSticker>

A read-only collection of all custom stickers for this guild.

SystemChannelFlags

Gets the flags for the types of system channel messages that are disabled.

SystemChannelMessageDeny SystemChannelFlags { get; }

Property Value

SystemChannelMessageDeny

The flags for the types of system channel messages that are disabled.

SystemChannelId

Gets the ID of the channel where randomized welcome messages are sent.

ulong? SystemChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the system channel where randomized welcome messages are sent; null if none is set.

VanityURLCode

Gets the code for this guild's vanity invite URL.

string VanityURLCode { get; }

Property Value

string

A string containing the vanity invite code for this guild; null if none is set.

VerificationLevel

Gets the level of requirements a user must fulfill before being allowed to post messages in this guild.

VerificationLevel VerificationLevel { get; }

Property Value

VerificationLevel

The level of requirements.

VoiceRegionId

Gets the ID of the region hosting this guild's voice channels.

string VoiceRegionId { get; }

Property Value

string

A string containing the identifier for the voice region that this guild uses (e.g. eu-central).

WidgetChannelId

Gets the ID of the channel assigned to the widget of this guild.

ulong? WidgetChannelId { get; }

Property Value

ulong?

A ulong representing the snowflake identifier of the channel assigned to the widget found within the widget settings of this guild; null if none is set.

Methods

AddBanAsync(IUser, int, string, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)

Parameters

user IUser

The user to ban.

pruneDays int

The number of days to remove messages from this user for, and this number must be between [0, 7].

reason string

The reason of the ban to be written in the audit log.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous add operation for the ban.

Exceptions

ArgumentException

pruneDays is not between 0 to 7.

AddBanAsync(ulong, int, string, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Task AddBanAsync(ulong userId, int pruneDays = 0, string reason = null, RequestOptions options = null)

Parameters

userId ulong

The snowflake ID of the user to ban.

pruneDays int

The number of days to remove messages from this user for, and this number must be between [0, 7].

reason string

The reason of the ban to be written in the audit log.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous add operation for the ban.

Exceptions

ArgumentException

pruneDays is not between 0 to 7.

AddGuildUserAsync(ulong, string, Action<AddGuildUserProperties>, RequestOptions)

Adds a user to this guild.

Task<IGuildUser> AddGuildUserAsync(ulong userId, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)

Parameters

userId ulong

The snowflake identifier of the user.

accessToken string

The OAuth2 access token for the user, requested with the guilds.join scope.

func Action<AddGuildUserProperties>

The delegate containing the properties to be applied to the user upon being added to the guild.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildUser>

A guild user associated with the specified userId; null if the user is already in the guild.

Remarks

This method requires you have an OAuth2 access token for the user, requested with the guilds.join scope, and that the bot have the MANAGE_INVITES permission in the guild.

BanUserAsync(IUser, uint, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Task BanUserAsync(IUser user, uint pruneSeconds = 0, RequestOptions options = null)

Parameters

user IUser

The user to ban.

pruneSeconds uint

The number of seconds to remover messages from this user for, between 0 and 604800

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous add operation for the ban.

BanUserAsync(ulong, uint, RequestOptions)

Bans the user from this guild and optionally prunes their recent messages.

Task BanUserAsync(ulong userId, uint pruneSeconds = 0, RequestOptions options = null)

Parameters

userId ulong

The ID of the user to ban.

pruneSeconds uint

The number of seconds to remover messages from this user for, between 0 and 604800

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous add operation for the ban.

BulkBanAsync(IEnumerable<ulong>, int?, RequestOptions)

Executes a bulk ban on the specified users.

Task<BulkBanResult> BulkBanAsync(IEnumerable<ulong> userIds, int? deleteMessageSeconds = null, RequestOptions options = null)

Parameters

userIds IEnumerable<ulong>

A collection of user ids to ban.

deleteMessageSeconds int?

The number of seconds to delete messages for. Max 604800.

options RequestOptions

The options to be used when sending the request.

Returns

Task<BulkBanResult>

A task that represents the asynchronous creation operation. The task result contains a BulkBanResult.

BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[], RequestOptions)

Overwrites the application commands within this guild.

Task<IReadOnlyCollection<IApplicationCommand>> BulkOverwriteApplicationCommandsAsync(ApplicationCommandProperties[] properties, RequestOptions options = null)

Parameters

properties ApplicationCommandProperties[]

A collection of properties to use when creating the commands.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IApplicationCommand>>

A task that represents the asynchronous creation operation. The task result contains a collection of commands that was created.

CreateApplicationCommandAsync(ApplicationCommandProperties, RequestOptions)

Creates an application command within this guild.

Task<IApplicationCommand> CreateApplicationCommandAsync(ApplicationCommandProperties properties, RequestOptions options = null)

Parameters

properties ApplicationCommandProperties

The properties to use when creating the command.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IApplicationCommand>

A task that represents the asynchronous creation operation. The task result contains the command that was created.

CreateAutoModRuleAsync(Action<AutoModRuleProperties>, RequestOptions)

Creates a new auto moderation rule.

Task<IAutoModRule> CreateAutoModRuleAsync(Action<AutoModRuleProperties> props, RequestOptions options = null)

Parameters

props Action<AutoModRuleProperties>
options RequestOptions

Returns

Task<IAutoModRule>

A task that represents the asynchronous creation operation. The task result contains the created IAutoModRule.

CreateCategoryAsync(string, Action<GuildChannelProperties>, RequestOptions)

Creates a new channel category in this guild.

Task<ICategoryChannel> CreateCategoryAsync(string name, Action<GuildChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the category.

func Action<GuildChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ICategoryChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created category channel.

CreateEmoteAsync(string, Image, Optional<IEnumerable<IRole>>, RequestOptions)

Creates a new GuildEmote in this guild.

Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default, RequestOptions options = null)

Parameters

name string

The name of the guild emote.

image Image

The image of the new emote.

roles Optional<IEnumerable<IRole>>

The roles to limit the emote usage to.

options RequestOptions

The options to be used when sending the request.

Returns

Task<GuildEmote>

A task that represents the asynchronous creation operation. The task result contains the created emote.

CreateEventAsync(string, DateTimeOffset, GuildScheduledEventType, GuildScheduledEventPrivacyLevel, string, DateTimeOffset?, ulong?, string, Image?, RequestOptions)

Creates an event within this guild.

Task<IGuildScheduledEvent> CreateEventAsync(string name, DateTimeOffset startTime, GuildScheduledEventType type, GuildScheduledEventPrivacyLevel privacyLevel = GuildScheduledEventPrivacyLevel.Private, string description = null, DateTimeOffset? endTime = null, ulong? channelId = null, string location = null, Image? coverImage = null, RequestOptions options = null)

Parameters

name string

The name of the event.

startTime DateTimeOffset

The start time of the event.

type GuildScheduledEventType

The type of the event.

privacyLevel GuildScheduledEventPrivacyLevel

The privacy level of the event.

description string

The description of the event.

endTime DateTimeOffset?

The end time of the event.

channelId ulong?

The channel id of the event. The event must have a type of Stage or Voice in order to use this property.

location string

The location of the event; links are supported

coverImage Image?

The optional banner image for the event.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildScheduledEvent>

A task that represents the asynchronous create operation.

CreateForumChannelAsync(string, Action<ForumChannelProperties>, RequestOptions)

Creates a new channel forum in this guild.

Task<IForumChannel> CreateForumChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the forum.

func Action<ForumChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IForumChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created forum channel.

CreateMediaChannelAsync(string, Action<ForumChannelProperties>, RequestOptions)

Creates a new media channel in this guild.

Task<IMediaChannel> CreateMediaChannelAsync(string name, Action<ForumChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the media channel.

func Action<ForumChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IMediaChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created forum channel.

CreateNewsChannelAsync(string, Action<TextChannelProperties>, RequestOptions)

Creates a new announcement channel in this guild.

Task<INewsChannel> CreateNewsChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the announcement channel.

func Action<TextChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<INewsChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created announcement channel.

Remarks

Announcement channels are only available in Community guilds.

CreateRoleAsync(string, GuildPermissions?, Color?, bool, RequestOptions)

Creates a new role with the provided name.

Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, RequestOptions options = null)

Parameters

name string

The new name for the role.

permissions GuildPermissions?

The guild permission that the role should possess.

color Color?

The color of the role.

isHoisted bool

Whether the role is separated from others on the sidebar.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

CreateRoleAsync(string, GuildPermissions?, Color?, bool, bool, RequestOptions, Image?, Emoji)

Creates a new role with the provided name.

Task<IRole> CreateRoleAsync(string name, GuildPermissions? permissions = null, Color? color = null, bool isHoisted = false, bool isMentionable = false, RequestOptions options = null, Image? icon = null, Emoji emoji = null)

Parameters

name string

The new name for the role.

permissions GuildPermissions?

The guild permission that the role should possess.

color Color?

The color of the role.

isHoisted bool

Whether the role is separated from others on the sidebar.

isMentionable bool

Whether the role can be mentioned.

options RequestOptions

The options to be used when sending the request.

icon Image?

The icon for the role.

emoji Emoji

The unicode emoji to be used as an icon for the role.

Returns

Task<IRole>

A task that represents the asynchronous creation operation. The task result contains the newly created role.

CreateStageChannelAsync(string, Action<VoiceChannelProperties>, RequestOptions)

Creates a new stage channel in this guild.

Task<IStageChannel> CreateStageChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the stage channel.

func Action<VoiceChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IStageChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created stage channel.

CreateStickerAsync(string, Image, IEnumerable<string>, string, RequestOptions)

Creates a new sticker in this guild.

Task<ICustomSticker> CreateStickerAsync(string name, Image image, IEnumerable<string> tags, string description = null, RequestOptions options = null)

Parameters

name string

The name of the sticker.

image Image

The image of the new emote.

tags IEnumerable<string>

The tags of the sticker.

description string

The description of the sticker.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ICustomSticker>

A task that represents the asynchronous creation operation. The task result contains the created sticker.

CreateStickerAsync(string, Stream, string, IEnumerable<string>, string, RequestOptions)

Creates a new sticker in this guild.

Task<ICustomSticker> CreateStickerAsync(string name, Stream stream, string filename, IEnumerable<string> tags, string description = null, RequestOptions options = null)

Parameters

name string

The name of the sticker.

stream Stream

The stream containing the file data.

filename string

The name of the file with the extension, ex: image.png.

tags IEnumerable<string>

The tags of the sticker.

description string

The description of the sticker.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ICustomSticker>

A task that represents the asynchronous creation operation. The task result contains the created sticker.

CreateStickerAsync(string, string, IEnumerable<string>, string, RequestOptions)

Creates a new sticker in this guild.

Task<ICustomSticker> CreateStickerAsync(string name, string path, IEnumerable<string> tags, string description = null, RequestOptions options = null)

Parameters

name string

The name of the sticker.

path string

The path of the file to upload.

tags IEnumerable<string>

The tags of the sticker.

description string

The description of the sticker.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ICustomSticker>

A task that represents the asynchronous creation operation. The task result contains the created sticker.

CreateTextChannelAsync(string, Action<TextChannelProperties>, RequestOptions)

Creates a new text channel in this guild.

Task<ITextChannel> CreateTextChannelAsync(string name, Action<TextChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the text channel.

func Action<TextChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created text channel.

Examples

The following example creates a new text channel under an existing category named Wumpus with a set topic.

public async Task CreateTextChannelUnderWumpus(IGuild guild, string name)
{
    var categories = await guild.GetCategoriesAsync();
    var targetCategory = categories.FirstOrDefault(x => x.Name == "wumpus");
    if (targetCategory == null) return;
    await guild.CreateTextChannelAsync(name, x =>
    {
        x.CategoryId = targetCategory.Id;
        x.Topic = $"This channel was created at {DateTimeOffset.UtcNow}.";
    });
}

CreateVoiceChannelAsync(string, Action<VoiceChannelProperties>, RequestOptions)

Creates a new voice channel in this guild.

Task<IVoiceChannel> CreateVoiceChannelAsync(string name, Action<VoiceChannelProperties> func = null, RequestOptions options = null)

Parameters

name string

The new name for the voice channel.

func Action<VoiceChannelProperties>

The delegate containing the properties to be applied to the channel upon its creation.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IVoiceChannel>

A task that represents the asynchronous creation operation. The task result contains the newly created voice channel.

DeleteEmoteAsync(GuildEmote, RequestOptions)

Deletes an existing GuildEmote from this guild.

Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null)

Parameters

emote GuildEmote

The emote to delete.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous removal operation.

DeleteIntegrationAsync(ulong, RequestOptions)

Deletes an integration.

Task DeleteIntegrationAsync(ulong id, RequestOptions options = null)

Parameters

id ulong

The id for the integration.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous removal operation.

DeleteStickerAsync(ICustomSticker, RequestOptions)

Deletes a sticker within this guild.

Task DeleteStickerAsync(ICustomSticker sticker, RequestOptions options = null)

Parameters

sticker ICustomSticker

The sticker to delete.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous removal operation.

DisconnectAsync(IGuildUser)

Disconnects the user from its current voice channel.

Task DisconnectAsync(IGuildUser user)

Parameters

user IGuildUser

The user to disconnect.

Returns

Task

A task that represents the asynchronous operation for disconnecting a user.

DownloadUsersAsync()

Downloads all users for this guild if the current list is incomplete.

Task DownloadUsersAsync()

Returns

Task

A task that represents the asynchronous download operation.

Remarks

This method downloads all users found within this guild through the Gateway and caches them.

GetAFKChannelAsync(CacheMode, RequestOptions)

Gets the AFK voice channel in this guild.

Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel that the AFK users will be moved to after they have idled for too long; null if none is set.

GetApplicationCommandAsync(ulong, CacheMode, RequestOptions)

Gets an application command within this guild with the specified id.

Task<IApplicationCommand> GetApplicationCommandAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The id of the application command to get.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IApplicationCommand>

A ValueTask that represents the asynchronous get operation. The task result contains a IApplicationCommand if found, otherwise null.

GetApplicationCommandsAsync(bool, string, RequestOptions)

Gets this guilds application commands.

Task<IReadOnlyCollection<IApplicationCommand>> GetApplicationCommandsAsync(bool withLocalizations = false, string locale = null, RequestOptions options = null)

Parameters

withLocalizations bool

Whether to include full localization dictionaries in the returned objects, instead of the localized name and description fields.

locale string

The target locale of the localized name and description fields. Sets the X-Discord-Locale header, which takes precedence over Accept-Language.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IApplicationCommand>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of application commands found within the guild.

GetAuditLogsAsync(int, CacheMode, RequestOptions, ulong?, ulong?, ActionType?, ulong?)

Gets the specified number of audit log entries for this guild.

Task<IReadOnlyCollection<IAuditLogEntry>> GetAuditLogsAsync(int limit = 100, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null, ulong? beforeId = null, ulong? userId = null, ActionType? actionType = null, ulong? afterId = null)

Parameters

limit int

The number of audit log entries to fetch.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

beforeId ulong?

The audit log entry ID to get entries before.

userId ulong?

The user ID to filter entries for.

actionType ActionType?

The type of actions to filter.

afterId ulong?

The audit log entry ID to get entries after.

Returns

Task<IReadOnlyCollection<IAuditLogEntry>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of the requested audit log entries.

GetAutoModRuleAsync(ulong, RequestOptions)

Gets a single rule configured in a guild. Returns null if the rule was not found.

Task<IAutoModRule> GetAutoModRuleAsync(ulong ruleId, RequestOptions options = null)

Parameters

ruleId ulong
options RequestOptions

Returns

Task<IAutoModRule>

A task that represents the asynchronous creation operation. The task result contains a IAutoModRule.

GetAutoModRulesAsync(RequestOptions)

Get a list of all rules currently configured for the guild.

Task<IAutoModRule[]> GetAutoModRulesAsync(RequestOptions options = null)

Parameters

options RequestOptions

Returns

Task<IAutoModRule[]>

A task that represents the asynchronous creation operation. The task result contains a collection of IAutoModRule.

GetBanAsync(IUser, RequestOptions)

Gets a ban object for a banned user.

Task<IBan> GetBanAsync(IUser user, RequestOptions options = null)

Parameters

user IUser

The banned user.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

GetBanAsync(ulong, RequestOptions)

Gets a ban object for a banned user.

Task<IBan> GetBanAsync(ulong userId, RequestOptions options = null)

Parameters

userId ulong

The snowflake identifier for the banned user.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IBan>

A task that represents the asynchronous get operation. The task result contains a ban object, which contains the user information and the reason for the ban; null if the ban entry cannot be found.

GetBansAsync(IUser, Direction, int, RequestOptions)

Gets limit amount of bans from the guild starting at the provided fromUser ordered by user ID.

IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(IUser fromUser, Direction dir, int limit = 1000, RequestOptions options = null)

Parameters

fromUser IUser

The user to start to get bans from.

dir Direction

The direction of the bans to be gotten.

limit int

The number of bans to get.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IBan>>

A paged collection of bans.

Remarks

important

The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.

warning

Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!

GetBansAsync(int, RequestOptions)

Gets limit amount of bans from the guild ordered by user ID.

IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(int limit = 1000, RequestOptions options = null)

Parameters

limit int

The amount of bans to get from the guild.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IBan>>

A paged collection of bans.

Remarks

important

The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.

warning

Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!

GetBansAsync(ulong, Direction, int, RequestOptions)

Gets limit amount of bans from the guild starting at the provided fromUserId ordered by user ID.

IAsyncEnumerable<IReadOnlyCollection<IBan>> GetBansAsync(ulong fromUserId, Direction dir, int limit = 1000, RequestOptions options = null)

Parameters

fromUserId ulong

The ID of the user to start to get bans from.

dir Direction

The direction of the bans to be gotten.

limit int

The number of bans to get.

options RequestOptions

The options to be used when sending the request.

Returns

IAsyncEnumerable<IReadOnlyCollection<IBan>>

A paged collection of bans.

Remarks

important

The returned collection is an asynchronous enumerable object; one must call FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>) to access the individual messages as a collection.

warning

Do not fetch too many bans at once! This may cause unwanted preemptive rate limit or even actual rate limit, causing your bot to freeze!

GetCategoriesAsync(CacheMode, RequestOptions)

Gets a collection of all category channels in this guild.

Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<ICategoryChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of category channels found within this guild.

GetChannelAsync(ulong, CacheMode, RequestOptions)

Gets a channel in this guild.

Task<IGuildChannel> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildChannel>

A task that represents the asynchronous get operation. The task result contains the generic channel associated with the specified id; null if none is found.

GetChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all channels in this guild.

Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IGuildChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of generic channels found within this guild.

GetCurrentUserAsync(CacheMode, RequestOptions)

Gets the current user for this guild.

Task<IGuildUser> GetCurrentUserAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the currently logged-in user within this guild.

GetDefaultChannelAsync(CacheMode, RequestOptions)

Gets the first viewable text channel in this guild.

Task<ITextChannel> GetDefaultChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the first viewable text channel in this guild; null if none is found.

GetEmoteAsync(ulong, RequestOptions)

Gets a specific emote from this guild.

Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the guild emote.

options RequestOptions

The options to be used when sending the request.

Returns

Task<GuildEmote>

A task that represents the asynchronous get operation. The task result contains the emote found with the specified id; null if none is found.

GetEmotesAsync(RequestOptions)

Gets a collection of emotes from this guild.

Task<IReadOnlyCollection<GuildEmote>> GetEmotesAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<GuildEmote>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of emotes found within the guild.

GetEventAsync(ulong, RequestOptions)

Gets a event within this guild.

Task<IGuildScheduledEvent> GetEventAsync(ulong id, RequestOptions options = null)

Parameters

id ulong

The id of the event.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildScheduledEvent>

A task that represents the asynchronous get operation.

GetEventsAsync(RequestOptions)

Gets a collection of events within this guild.

Task<IReadOnlyCollection<IGuildScheduledEvent>> GetEventsAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IGuildScheduledEvent>>

A task that represents the asynchronous get operation.

GetForumChannelAsync(ulong, CacheMode, RequestOptions)

Gets a forum channel in this guild.

Task<IForumChannel> GetForumChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the stage channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IForumChannel>

A task that represents the asynchronous get operation. The task result contains the stage channel associated with the specified id; null if none is found.

GetForumChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all forum channels in this guild.

Task<IReadOnlyCollection<IForumChannel>> GetForumChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IForumChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of forum channels found within this guild.

GetIntegrationsAsync(RequestOptions)

Gets a collection of all the integrations this guild contains.

Task<IReadOnlyCollection<IIntegration>> GetIntegrationsAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IIntegration>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of integrations the guild can has.

GetInvitesAsync(RequestOptions)

Gets a collection of all invites in this guild.

Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IInviteMetadata>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata, each representing information for an invite found within this guild.

GetMediaChannelAsync(ulong, CacheMode, RequestOptions)

Gets a forum channel in this guild.

Task<IMediaChannel> GetMediaChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the stage channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IMediaChannel>

A task that represents the asynchronous get operation. The task result contains the stage channel associated with the specified id; null if none is found.

GetMediaChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all forum channels in this guild.

Task<IReadOnlyCollection<IMediaChannel>> GetMediaChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IMediaChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of media channels found within this guild.

GetOnboardingAsync(RequestOptions)

Gets the onboarding object configured for the guild.

Task<IGuildOnboarding> GetOnboardingAsync(RequestOptions options = null)

Parameters

options RequestOptions

Returns

Task<IGuildOnboarding>

A task that represents the asynchronous creation operation. The task result contains the created IGuildOnboarding.

GetOwnerAsync(CacheMode, RequestOptions)

Gets the owner of this guild.

Task<IGuildUser> GetOwnerAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the owner of this guild.

GetPublicUpdatesChannelAsync(CacheMode, RequestOptions)

Gets the text channel where admins and moderators of Community guilds receive notices from Discord.

Task<ITextChannel> GetPublicUpdatesChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel where admins and moderators of Community guilds receive notices from Discord; null if none is set.

GetRole(ulong)

Gets a role in this guild.

IRole GetRole(ulong id)

Parameters

id ulong

The snowflake identifier for the role.

Returns

IRole

A role that is associated with the specified id; null if none is found.

GetRoleAsync(ulong, RequestOptions)

Gets a role in this guild.

Task<IRole> GetRoleAsync(ulong id, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the role.

options RequestOptions

Returns

Task<IRole>

A task that represents the asynchronous creation operation. The task result contains the role that is associated with the specified id; null if none is found.

GetRulesChannelAsync(CacheMode, RequestOptions)

Gets the text channel where Community guilds can display rules and/or guidelines.

Task<ITextChannel> GetRulesChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel where Community guilds can display rules and/or guidelines; null if none is set.

GetStageChannelAsync(ulong, CacheMode, RequestOptions)

Gets a stage channel in this guild.

Task<IStageChannel> GetStageChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the stage channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IStageChannel>

A task that represents the asynchronous get operation. The task result contains the stage channel associated with the specified id; null if none is found.

GetStageChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all stage channels in this guild.

Task<IReadOnlyCollection<IStageChannel>> GetStageChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IStageChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of stage channels found within this guild.

GetStickerAsync(ulong, CacheMode, RequestOptions)

Gets a specific sticker within this guild.

Task<ICustomSticker> GetStickerAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The id of the sticker to get.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ICustomSticker>

A task that represents the asynchronous get operation. The task result contains the sticker found with the specified id; null if none is found.

GetStickersAsync(CacheMode, RequestOptions)

Gets a collection of all stickers within this guild.

Task<IReadOnlyCollection<ICustomSticker>> GetStickersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<ICustomSticker>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of stickers found within the guild.

GetSystemChannelAsync(CacheMode, RequestOptions)

Gets the system channel where randomized welcome messages are sent in this guild.

Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel where randomized welcome messages will be sent to; null if none is set.

GetTextChannelAsync(ulong, CacheMode, RequestOptions)

Gets a text channel in this guild.

Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the text channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<ITextChannel>

A task that represents the asynchronous get operation. The task result contains the text channel associated with the specified id; null if none is found.

GetTextChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all text channels in this guild.

Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<ITextChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of message channels found within this guild.

GetThreadChannelAsync(ulong, CacheMode, RequestOptions)

Gets a thread channel within this guild.

Task<IThreadChannel> GetThreadChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The id of the thread channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IThreadChannel>

A task that represents the asynchronous get operation. The task result contains the thread channel.

GetThreadChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all thread channels in this guild.

Task<IReadOnlyCollection<IThreadChannel>> GetThreadChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IThreadChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of thread channels found within this guild.

GetUserAsync(ulong, CacheMode, RequestOptions)

Gets a user from this guild.

Task<IGuildUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier of the user.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildUser>

A task that represents the asynchronous get operation. The task result contains the guild user associated with the specified id; null if none is found.

Remarks

This method retrieves a user found within this guild.

note

This may return null in the WebSocket implementation due to incomplete user collection in large guilds.

GetUsersAsync(CacheMode, RequestOptions)

Gets a collection of all users in this guild.

Task<IReadOnlyCollection<IGuildUser>> GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IGuildUser>>

A task that represents the asynchronous get operation. The task result contains a collection of guild users found within this guild.

Remarks

This method retrieves all users found within this guild.

note

This may return an incomplete collection in the WebSocket implementation due to how Discord does not send a complete user list for large guilds.

GetVanityInviteAsync(RequestOptions)

Gets the vanity invite URL of this guild.

Task<IInviteMetadata> GetVanityInviteAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IInviteMetadata>

A task that represents the asynchronous get operation. The task result contains the partial metadata of the vanity invite found within this guild; null if none is found.

GetVoiceChannelAsync(ulong, CacheMode, RequestOptions)

Gets a voice channel in this guild.

Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

id ulong

The snowflake identifier for the voice channel.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IVoiceChannel>

A task that represents the asynchronous get operation. The task result contains the voice channel associated with the specified id; null if none is found.

GetVoiceChannelsAsync(CacheMode, RequestOptions)

Gets a collection of all voice channels in this guild.

Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IVoiceChannel>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice channels found within this guild.

GetVoiceRegionsAsync(RequestOptions)

Gets a collection of all the voice regions this guild can access.

Task<IReadOnlyCollection<IVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IVoiceRegion>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of voice regions the guild can access.

GetWebhookAsync(ulong, RequestOptions)

Gets a webhook found within this guild.

Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)

Parameters

id ulong

The identifier for the webhook.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IWebhook>

A task that represents the asynchronous get operation. The task result contains the webhook with the specified id; null if none is found.

GetWebhooksAsync(RequestOptions)

Gets a collection of all webhook from this guild.

Task<IReadOnlyCollection<IWebhook>> GetWebhooksAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IWebhook>>

A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks found within the guild.

GetWelcomeScreenAsync(RequestOptions)

Gets the welcome screen of the guild. Returns null if the welcome channel is not set.

Task<WelcomeScreen> GetWelcomeScreenAsync(RequestOptions options = null)

Parameters

options RequestOptions

Returns

Task<WelcomeScreen>

A task that represents the asynchronous creation operation. The task result contains a WelcomeScreen.

GetWidgetChannelAsync(CacheMode, RequestOptions)

Gets the widget channel (i.e. the channel set in the guild's widget settings) in this guild.

Task<IGuildChannel> GetWidgetChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IGuildChannel>

A task that represents the asynchronous get operation. The task result contains the widget channel set within the server's widget settings; null if none is set.

LeaveAsync(RequestOptions)

Leaves this guild.

Task LeaveAsync(RequestOptions options = null)

Parameters

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous leave operation.

Remarks

This method will make the currently logged-in user leave the guild.

note

If the user is the owner of this guild, use DeleteAsync(RequestOptions) instead.

ModifyAsync(Action<GuildProperties>, RequestOptions)

Modifies this guild.

Task ModifyAsync(Action<GuildProperties> func, RequestOptions options = null)

Parameters

func Action<GuildProperties>

The delegate containing the properties to modify the guild with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

ModifyEmoteAsync(GuildEmote, Action<EmoteProperties>, RequestOptions)

Modifies an existing GuildEmote in this guild.

Task<GuildEmote> ModifyEmoteAsync(GuildEmote emote, Action<EmoteProperties> func, RequestOptions options = null)

Parameters

emote GuildEmote

The emote to be modified.

func Action<EmoteProperties>

The delegate containing the properties to modify the emote with.

options RequestOptions

The options to be used when sending the request.

Returns

Task<GuildEmote>

A task that represents the asynchronous modification operation. The task result contains the modified emote.

ModifyIncidentActionsAsync(Action<GuildIncidentsDataProperties>, RequestOptions)

Modifies the incident actions of the guild.

Task<GuildIncidentsData> ModifyIncidentActionsAsync(Action<GuildIncidentsDataProperties> props, RequestOptions options = null)

Parameters

props Action<GuildIncidentsDataProperties>
options RequestOptions

Returns

Task<GuildIncidentsData>

A task that represents the asynchronous creation operation. The task result contains the modified IncidentsData.

ModifyOnboardingAsync(Action<GuildOnboardingProperties>, RequestOptions)

Modifies the onboarding object configured for the guild.

Task<IGuildOnboarding> ModifyOnboardingAsync(Action<GuildOnboardingProperties> props, RequestOptions options = null)

Parameters

props Action<GuildOnboardingProperties>
options RequestOptions

Returns

Task<IGuildOnboarding>

A task that represents the asynchronous creation operation. The task result contains the modified IGuildOnboarding.

ModifyWelcomeScreenAsync(bool, WelcomeScreenChannelProperties[], string, RequestOptions)

Modifies the welcome screen of the guild. Returns null if welcome screen is removed.

Task<WelcomeScreen> ModifyWelcomeScreenAsync(bool enabled, WelcomeScreenChannelProperties[] channels, string description = null, RequestOptions options = null)

Parameters

enabled bool
channels WelcomeScreenChannelProperties[]
description string
options RequestOptions

Returns

Task<WelcomeScreen>

A task that represents the asynchronous creation operation. The task result contains a WelcomeScreen.

ModifyWidgetAsync(Action<GuildWidgetProperties>, RequestOptions)

Modifies this guild's widget.

Task ModifyWidgetAsync(Action<GuildWidgetProperties> func, RequestOptions options = null)

Parameters

func Action<GuildWidgetProperties>

The delegate containing the properties to modify the guild widget with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous modification operation.

MoveAsync(IGuildUser, IVoiceChannel)

Moves the user to the voice channel.

Task MoveAsync(IGuildUser user, IVoiceChannel targetChannel)

Parameters

user IGuildUser

The user to move.

targetChannel IVoiceChannel

the channel where the user gets moved to.

Returns

Task

A task that represents the asynchronous operation for moving a user.

PruneUsersAsync(int, bool, RequestOptions, IEnumerable<ulong>)

Prunes inactive users.

Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)

Parameters

days int

The number of days required for the users to be kicked.

simulate bool

Whether this prune action is a simulation.

options RequestOptions

The options to be used when sending the request.

includeRoleIds IEnumerable<ulong>

An array of role IDs to be included in the prune of users who do not have any additional roles.

Returns

Task<int>

A task that represents the asynchronous prune operation. The task result contains the number of users to be or has been removed from this guild.

Remarks

This method removes all users that have not logged on in the provided number of days.

If simulate is true, this method will only return the number of users that would be removed without kicking the users.

RemoveBanAsync(IUser, RequestOptions)

Unbans the user if they are currently banned.

Task RemoveBanAsync(IUser user, RequestOptions options = null)

Parameters

user IUser

The user to be unbanned.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous removal operation for the ban.

RemoveBanAsync(ulong, RequestOptions)

Unbans the user if they are currently banned.

Task RemoveBanAsync(ulong userId, RequestOptions options = null)

Parameters

userId ulong

The snowflake identifier of the user to be unbanned.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous removal operation for the ban.

ReorderChannelsAsync(IEnumerable<ReorderChannelProperties>, RequestOptions)

Bulk-modifies the order of channels in this guild.

Task ReorderChannelsAsync(IEnumerable<ReorderChannelProperties> args, RequestOptions options = null)

Parameters

args IEnumerable<ReorderChannelProperties>

The properties used to modify the channel positions with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous reorder operation.

ReorderRolesAsync(IEnumerable<ReorderRoleProperties>, RequestOptions)

Bulk-modifies the order of roles in this guild.

Task ReorderRolesAsync(IEnumerable<ReorderRoleProperties> args, RequestOptions options = null)

Parameters

args IEnumerable<ReorderRoleProperties>

The properties used to modify the role positions with.

options RequestOptions

The options to be used when sending the request.

Returns

Task

A task that represents the asynchronous reorder operation.

SearchUsersAsync(string, int, CacheMode, RequestOptions)

Gets a collection of users in this guild that the name or nickname starts with the provided string at query.

Task<IReadOnlyCollection<IGuildUser>> SearchUsersAsync(string query, int limit = 1000, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

Parameters

query string

The partial name or nickname to search.

limit int

The maximum number of users to be gotten.

mode CacheMode

The CacheMode that determines whether the object should be fetched from cache.

options RequestOptions

The options to be used when sending the request.

Returns

Task<IReadOnlyCollection<IGuildUser>>

A task that represents the asynchronous get operation. The task result contains a collection of guild users that the name or nickname starts with the provided string at query.

Remarks

The limit can not be higher than MaxUsersPerBatch.

SearchUsersAsyncV2(int, MemberSearchPropertiesV2, RequestOptions)

Gets a collection of users in this guild that match the provided search criteria.

Task<MemberSearchResult> SearchUsersAsyncV2(int limit = 1000, MemberSearchPropertiesV2 args = null, RequestOptions options = null)

Parameters

limit int
args MemberSearchPropertiesV2
options RequestOptions

Returns

Task<MemberSearchResult>