Table of Contents

Class RestClient

Namespace
NetCord.Rest
Assembly
NetCord.dll
public sealed class RestClient : IDisposable
Inheritance
RestClient
Implements
Inherited Members

Constructors

RestClient(IToken, RestClientConfiguration?)

public RestClient(IToken token, RestClientConfiguration? configuration = null)

Parameters

token IToken
configuration RestClientConfiguration

RestClient(RestClientConfiguration?)

public RestClient(RestClientConfiguration? configuration = null)

Parameters

configuration RestClientConfiguration

Properties

Token

The token of the RestClient.

public IToken? Token { get; }

Property Value

IToken

Methods

AddGuildThreadUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Adds another user to a thread.

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

Parameters

threadId ulong

The ID of the thread.

userId ulong

The ID of the user to add to the thread.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

AddGuildUserAsync(ulong, ulong, GuildUserProperties, RestRequestProperties?, CancellationToken)

public Task<GuildUser?> AddGuildUserAsync(ulong guildId, ulong userId, GuildUserProperties userProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
userId ulong
userProperties GuildUserProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

AddGuildUserRoleAsync(ulong, ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

AddMessageReactionAsync(ulong, ulong, ReactionEmojiProperties, RestRequestProperties?, CancellationToken)

Adds a reaction to a specific message.

public Task AddMessageReactionAsync(ulong channelId, ulong messageId, ReactionEmojiProperties emoji, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to react to.

emoji ReactionEmojiProperties

The emoji to use as the reaction.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

BanGuildUserAsync(ulong, ulong, int, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
deleteMessageSeconds int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

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

public Task<GuildBulkBan> BanGuildUsersAsync(ulong guildId, IEnumerable<ulong> userIds, int deleteMessageSeconds = 0, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
userIds IEnumerable<ulong>
deleteMessageSeconds int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildBulkBan>

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

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

Parameters

applicationId ulong
commands IEnumerable<ApplicationCommandProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ApplicationCommand>>

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

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

Parameters

applicationId ulong
guildId ulong
commands IEnumerable<ApplicationCommandProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildApplicationCommand>>

ConsumeEntitlementAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task ConsumeEntitlementAsync(ulong applicationId, ulong entitlementId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
entitlementId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

CreateApplicationEmojiAsync(ulong, ApplicationEmojiProperties, RestRequestProperties?, CancellationToken)

public Task<ApplicationEmoji> CreateApplicationEmojiAsync(ulong applicationId, ApplicationEmojiProperties applicationEmojiProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
applicationEmojiProperties ApplicationEmojiProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationEmoji>

CreateAutoModerationRuleAsync(ulong, AutoModerationRuleProperties, RestRequestProperties?, CancellationToken)

Creates a new auto-moderation rule for a specified guild.

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

Parameters

guildId ulong

The ID of the guild to create the rule for.

autoModerationRuleProperties AutoModerationRuleProperties

The properties of the auto-moderation rule to be created, including triggers, actions, and conditions.

properties RestRequestProperties

Optional properties to customize the request, catn be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<AutoModerationRule>

CreateForumGuildThreadAsync(ulong, ForumGuildThreadProperties, RestRequestProperties?, CancellationToken)

Creates a new thread in a forum channel.

public Task<ForumGuildThread> CreateForumGuildThreadAsync(ulong channelId, ForumGuildThreadProperties threadProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the forum channel.

threadProperties ForumGuildThreadProperties

The properties of the forum thread to create.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<ForumGuildThread>

CreateGlobalApplicationCommandAsync(ulong, ApplicationCommandProperties, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
applicationCommandProperties ApplicationCommandProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommand>

CreateGoogleCloudPlatformStorageBucketsAsync(ulong, IEnumerable<GoogleCloudPlatformStorageBucketProperties>, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<GoogleCloudPlatformStorageBucket>> CreateGoogleCloudPlatformStorageBucketsAsync(ulong channelId, IEnumerable<GoogleCloudPlatformStorageBucketProperties> buckets, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong
buckets IEnumerable<GoogleCloudPlatformStorageBucketProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GoogleCloudPlatformStorageBucket>>

CreateGroupDMChannelAsync(GroupDMChannelProperties, RestRequestProperties?, CancellationToken)

public Task<GroupDMChannel> CreateGroupDMChannelAsync(GroupDMChannelProperties groupDMChannelProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

groupDMChannelProperties GroupDMChannelProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GroupDMChannel>

CreateGuildApplicationCommandAsync(ulong, ulong, ApplicationCommandProperties, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
applicationCommandProperties ApplicationCommandProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

CreateGuildAsync(GuildProperties, RestRequestProperties?, CancellationToken)

public Task<RestGuild> CreateGuildAsync(GuildProperties guildProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildProperties GuildProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

CreateGuildChannelAsync(ulong, GuildChannelProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
channelProperties GuildChannelProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IGuildChannel>

CreateGuildChannelInviteAsync(ulong, InviteProperties?, RestRequestProperties?, CancellationToken)

Creates a new invite for a guild channel.

public Task<RestInvite> CreateGuildChannelInviteAsync(ulong channelId, InviteProperties? inviteProperties = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the guild channel to create the invite for.

inviteProperties InviteProperties

The properties to configure the new invite. Can be null for defaults.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestInvite>

CreateGuildEmojiAsync(ulong, GuildEmojiProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
guildEmojiProperties GuildEmojiProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

CreateGuildFromGuildTemplateAsync(string, GuildFromGuildTemplateProperties, RestRequestProperties?, CancellationToken)

public Task<RestGuild> CreateGuildFromGuildTemplateAsync(string templateCode, GuildFromGuildTemplateProperties guildProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

templateCode string
guildProperties GuildFromGuildTemplateProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

CreateGuildRoleAsync(ulong, RoleProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
guildRoleProperties RoleProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

CreateGuildScheduledEventAsync(ulong, GuildScheduledEventProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
guildScheduledEventProperties GuildScheduledEventProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

CreateGuildStickerAsync(ulong, GuildStickerProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
sticker GuildStickerProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

CreateGuildTemplateAsync(ulong, GuildTemplateProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
guildTemplateProperties GuildTemplateProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

CreateGuildThreadAsync(ulong, GuildThreadProperties, RestRequestProperties?, CancellationToken)

Creates a standalone thread in a text channel.

public Task<GuildThread> CreateGuildThreadAsync(ulong channelId, GuildThreadProperties threadProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the text channel to create the thread in.

threadProperties GuildThreadProperties

The properties of the thread to create.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<GuildThread>

CreateGuildThreadAsync(ulong, ulong, GuildThreadFromMessageProperties, RestRequestProperties?, CancellationToken)

Creates a thread from an existing message in a text channel.

public Task<GuildThread> CreateGuildThreadAsync(ulong channelId, ulong messageId, GuildThreadFromMessageProperties threadFromMessageProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the text channel containing the message.

messageId ulong

The ID of the message to start the thread from.

threadFromMessageProperties GuildThreadFromMessageProperties

The properties of the thread to create.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<GuildThread>

CreateStageInstanceAsync(StageInstanceProperties, RestRequestProperties?, CancellationToken)

public Task<StageInstance> CreateStageInstanceAsync(StageInstanceProperties stageInstanceProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

stageInstanceProperties StageInstanceProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<StageInstance>

CreateTestEntitlementAsync(ulong, TestEntitlementProperties, RestRequestProperties?, CancellationToken)

public Task<Entitlement> CreateTestEntitlementAsync(ulong applicationId, TestEntitlementProperties testEntitlementProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
testEntitlementProperties TestEntitlementProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Entitlement>

CreateWebhookAsync(ulong, WebhookProperties, RestRequestProperties?, CancellationToken)

Creates a new webhook, and returns an IncomingWebhook object on success.

public Task<IncomingWebhook> CreateWebhookAsync(ulong channelId, WebhookProperties webhookProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to create the webhook in.

webhookProperties WebhookProperties

Properties to customize the webhook's appearance.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IncomingWebhook>

Remarks

Fires a WebhooksUpdate event.

CrosspostMessageAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Crossposts a message from an announcement channel to subscribed channels.

public Task<RestMessage> CrosspostMessageAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the announcement channel containing the message.

messageId ulong

The ID of the message to crosspost.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

DeleteAllMessageReactionsAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Removes all reactions from a message.

public Task DeleteAllMessageReactionsAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to clear reactions from.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteAllMessageReactionsForEmojiAsync(ulong, ulong, ReactionEmojiProperties, RestRequestProperties?, CancellationToken)

Removes all reactions of a specific emoji from a message.

public Task DeleteAllMessageReactionsForEmojiAsync(ulong channelId, ulong messageId, ReactionEmojiProperties emoji, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to clear emoji reactions from.

emoji ReactionEmojiProperties

The emoji to remove from all users.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteApplicationEmojiAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
emojiId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteAutoModerationRuleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Deletes an auto-moderation rule for a specified guild.

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

Parameters

guildId ulong

The ID of the guild to modify the rule for.

autoModerationRuleId ulong

The ID of the rule to modify.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteChannelAsync(ulong, RestRequestProperties?, CancellationToken)

Deletes a channel.

public Task<Channel> DeleteChannelAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to delete.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Channel>

DeleteCurrentUserMessageReactionAsync(ulong, ulong, ReactionEmojiProperties, RestRequestProperties?, CancellationToken)

Removes the current user's reaction from a specific message.

public Task DeleteCurrentUserMessageReactionAsync(ulong channelId, ulong messageId, ReactionEmojiProperties emoji, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to remove the reaction from.

emoji ReactionEmojiProperties

The emoji to remove as a reaction.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteGlobalApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildApplicationCommandAsync(ulong, ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteGuildAsync(ulong guildId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildChannelPermissionAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Deletes a permission overwrite for a user or role in a guild channel.

public Task DeleteGuildChannelPermissionAsync(ulong channelId, ulong overwriteId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the guild channel.

overwriteId ulong

The ID of the role or user whose permission overwrite is to be deleted.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteGuildEmojiAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
emojiId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildIntegrationAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
integrationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildScheduledEventAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
scheduledEventId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildStickerAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
stickerId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteGuildTemplateAsync(ulong, string, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
templateCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

DeleteGuildThreadUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Removes a user from a thread.

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

Parameters

threadId ulong

The ID of the thread.

userId ulong

The ID of the user to remove from the thread.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteInteractionFollowupMessageAsync(ulong, string, ulong, RestRequestProperties?, CancellationToken)

public Task DeleteInteractionFollowupMessageAsync(ulong applicationId, string interactionToken, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
messageId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteInteractionResponseAsync(ulong, string, RestRequestProperties?, CancellationToken)

public Task DeleteInteractionResponseAsync(ulong applicationId, string interactionToken, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteInviteAsync(string, RestRequestProperties?, CancellationToken)

public Task<RestInvite> DeleteInviteAsync(string inviteCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

inviteCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestInvite>

DeleteMessageAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Deletes a specific message from a channel.

public Task DeleteMessageAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to delete.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteMessagesAsync(ulong, IEnumerable<ulong>, RestRequestProperties?, CancellationToken)

Deletes a set of messages from a channel, in bulk.

public Task DeleteMessagesAsync(ulong channelId, IEnumerable<ulong> messageIds, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the messages.

messageIds IEnumerable<ulong>

The list of message IDs to delete.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteStageInstanceAsync(ulong, RestRequestProperties?, CancellationToken)

public Task DeleteStageInstanceAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteTestEntitlementAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task DeleteTestEntitlementAsync(ulong applicationId, ulong entitlementId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
entitlementId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

DeleteUserMessageReactionAsync(ulong, ulong, ReactionEmojiProperties, ulong, RestRequestProperties?, CancellationToken)

Removes a specific user's reaction from a message.

public Task DeleteUserMessageReactionAsync(ulong channelId, ulong messageId, ReactionEmojiProperties emoji, ulong userId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to remove the reaction from.

emoji ReactionEmojiProperties

The emoji to remove as a reaction.

userId ulong

The ID of the user whose reaction will be removed.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteWebhookAsync(ulong, RestRequestProperties?, CancellationToken)

Deletes a webhook permanently.

public Task DeleteWebhookAsync(ulong webhookId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to delete.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

Remarks

Fires a WebhooksUpdate event.

DeleteWebhookMessageAsync(ulong, string, ulong, ulong?, RestRequestProperties?, CancellationToken)

Deletes a previously-sent webhook message permanently.

public Task DeleteWebhookMessageAsync(ulong webhookId, string webhookToken, ulong messageId, ulong? threadId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to delete the message with.

webhookToken string

The token to use for authorization.

messageId ulong

The ID of the message to delete.

threadId ulong?

The ID of the thread the message is in.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

DeleteWebhookWithTokenAsync(ulong, string, RestRequestProperties?, CancellationToken)

Deletes a webhook permanently, using the specified token.

public Task DeleteWebhookWithTokenAsync(ulong webhookId, string webhookToken, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to delete.

webhookToken string

The token to use for authorization.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

Remarks

Requires the ManageWebhooks permission, and fires a WebhooksUpdate event.

Dispose()

public void Dispose()

EndMessagePollAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<RestMessage> EndMessagePollAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong
messageId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

EnterTypingScope(ulong, TypingScopeProperties?, RestRequestProperties?)

Enters a typing scope for a channel, while waiting for the typing indicator to trigger.

public IDisposable EnterTypingScope(ulong channelId, TypingScopeProperties? scopeProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the channel to type in.

scopeProperties TypingScopeProperties

Optional properties to customize the typing interval, can be null.

properties RestRequestProperties

Optional properties to customize the request, can be null.

Returns

IDisposable

EnterTypingScopeAsync(ulong, TypingScopeProperties?, RestRequestProperties?, CancellationToken)

Enters a typing scope for a channel, while waiting for the typing indicator to trigger.

public ValueTask<IDisposable> EnterTypingScopeAsync(ulong channelId, TypingScopeProperties? scopeProperties = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to type in.

scopeProperties TypingScopeProperties

Optional properties to customize the typing interval, can be null.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

ValueTask<IDisposable>

ExecuteWebhookAsync(ulong, string, WebhookMessageProperties, bool, ulong?, bool, RestRequestProperties?, CancellationToken)

Executes a webhook with the given parameters, optionally returning the message result.

public Task<RestMessage?> ExecuteWebhookAsync(ulong webhookId, string webhookToken, WebhookMessageProperties message, bool wait = false, ulong? threadId = null, bool withComponents = true, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to execute.

webhookToken string

The token to use for authorization.

message WebhookMessageProperties

The message to send through the webhook.

wait bool

If set, the returned RestMessage will contain the sent message, otherwise null.

threadId ulong?

Optional ID of the thread to send the message in, within the webhook's target channel. Can be null.

withComponents bool

Whether to respect the message's Components.

When enabled, allows application-owned webhooks to use all components, and non-owned webhooks to use non-interactive components.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

FindGuildUserAsync(ulong, string, int, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
name string
limit int
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildUser>>

FollowAnnouncementGuildChannelAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Follows an announcement channel to another channel.

public Task<FollowedChannel> FollowAnnouncementGuildChannelAsync(ulong channelId, ulong webhookChannelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the source announcement channel.

webhookChannelId ulong

The ID of the channel to receive crossposted messages.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<FollowedChannel>

GetActiveGuildThreadsAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildThread>>

GetApplicationAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<Application> GetApplicationAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Application>

GetApplicationCommandGuildPermissionsAsync(ulong, ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

GetApplicationCommandsGuildPermissionsAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ApplicationCommandGuildPermissions>>

GetApplicationEmojiAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<ApplicationEmoji> GetApplicationEmojiAsync(ulong applicationId, ulong emojiId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
emojiId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationEmoji>

GetApplicationEmojisAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ApplicationEmoji>>

GetApplicationRoleConnectionMetadataRecordsAsync(ulong, RestRequestProperties?, CancellationToken)

Returns a list of ApplicationRoleConnectionMetadata objects for the given application.

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

Parameters

applicationId ulong

The ID of the application to request data for.

properties RestRequestProperties

Optional properties to customize the REST request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes..

Returns

Task<IReadOnlyList<ApplicationRoleConnectionMetadata>>

GetAutoModerationRuleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Retrieves information about a specific auto-mod's rule configuration, for a specified guild.

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

Parameters

guildId ulong

The ID of the guild to retrieve auto-moderation rules for.

autoModerationRuleId ulong

The ID of the rule to retrieve information on.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<AutoModerationRule>

GetAutoModerationRulesAsync(ulong, RestRequestProperties?, CancellationToken)

Retrieves a read-only list of configured automod rules for a guild.

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

Parameters

guildId ulong

The ID of the guild to retrieve auto-moderation rules for.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<AutoModerationRule>>

GetChannelAsync(ulong, RestRequestProperties?, CancellationToken)

Retrieves a channel by its ID.

public Task<Channel> GetChannelAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to retrieve.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Channel>

GetChannelPinsAsync(ulong, PaginationProperties<DateTimeOffset>?, RestRequestProperties?, CancellationToken)

Retrieves all pinned messages in a channel.

public IAsyncEnumerable<MessagePin> GetChannelPinsAsync(ulong channelId, PaginationProperties<DateTimeOffset>? paginationProperties = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to get pinned messages from.

paginationProperties PaginationProperties<DateTimeOffset>

Optional properties to customize result pagination, can be null.

properties RestRequestProperties

Optional properties to customize each request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

IAsyncEnumerable<MessagePin>

Remarks

Requires the ViewChannel permission. If the user is missing the ReadMessageHistory permission in the channel, then no pins will be returned.

GetChannelWebhooksAsync(ulong, RestRequestProperties?, CancellationToken)

Returns a list of channel Webhook objects.

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

Parameters

channelId ulong

The ID of the channel to retrieve webhooks for.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<Webhook>>

GetCurrentApplicationAsync(RestRequestProperties?, CancellationToken)

Retrieves the application associated with the current user.

public Task<CurrentApplication> GetCurrentApplicationAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties

Optional properties to customize the REST request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes..

Returns

Task<CurrentApplication>

GetCurrentAuthorizationInformationAsync(RestRequestProperties?, CancellationToken)

public Task<AuthorizationInformation> GetCurrentAuthorizationInformationAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<AuthorizationInformation>

GetCurrentBotApplicationInformationAsync(RestRequestProperties?, CancellationToken)

public Task<CurrentApplication> GetCurrentBotApplicationInformationAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<CurrentApplication>

GetCurrentGuildUserVoiceStateAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<VoiceState>

GetCurrentUserApplicationRoleConnectionAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<ApplicationRoleConnection> GetCurrentUserApplicationRoleConnectionAsync(ulong applicationId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationRoleConnection>

GetCurrentUserAsync(RestRequestProperties?, CancellationToken)

public Task<CurrentUser> GetCurrentUserAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<CurrentUser>

GetCurrentUserConnectionsAsync(RestRequestProperties?, CancellationToken)

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

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Connection>>

GetCurrentUserGuildUserAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

GetCurrentUserGuildsAsync(GuildsPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<RestGuild> GetCurrentUserGuildsAsync(GuildsPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

paginationProperties GuildsPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<RestGuild>

GetDMChannelAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<DMChannel>

GetEntitlementAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<Entitlement> GetEntitlementAsync(ulong applicationId, ulong entitlementId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
entitlementId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Entitlement>

GetEntitlementsAsync(ulong, EntitlementsPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<Entitlement> GetEntitlementsAsync(ulong applicationId, EntitlementsPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

applicationId ulong
paginationProperties EntitlementsPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<Entitlement>

GetGatewayAsync(RestRequestProperties?, CancellationToken)

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

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<string>

GetGatewayBotAsync(RestRequestProperties?, CancellationToken)

public Task<GatewayBot> GetGatewayBotAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GatewayBot>

GetGlobalApplicationCommandAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommand>

GetGlobalApplicationCommandsAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ApplicationCommand>>

GetGuildApplicationCommandAsync(ulong, ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
commandId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

GetGuildApplicationCommandsAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildApplicationCommand>>

GetGuildAsync(ulong, bool, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
withCounts bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

GetGuildAuditLogAsync(ulong, GuildAuditLogPaginationProperties?, RestRequestProperties?)

Returns a collection of audit log entries for a guild, to be enumerated asynchronously.

public IAsyncEnumerable<RestAuditLogEntry> GetGuildAuditLogAsync(ulong guildId, GuildAuditLogPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

guildId ulong

The ID of the guild to acquire entries for.

paginationProperties GuildAuditLogPaginationProperties

Optional properties to customize result pagination, can be null.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<RestAuditLogEntry>

GetGuildBanAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildBan>

GetGuildBansAsync(ulong, PaginationProperties<ulong>?, RestRequestProperties?)

public IAsyncEnumerable<GuildBan> GetGuildBansAsync(ulong guildId, PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

guildId ulong
paginationProperties PaginationProperties<ulong>
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildBan>

GetGuildChannelInvitesAsync(ulong, RestRequestProperties?, CancellationToken)

Retrieves a list of active invites for a guild channel.

public Task<IReadOnlyList<RestInvite>> GetGuildChannelInvitesAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to retrieve invites for.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<RestInvite>>

GetGuildChannelsAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<IGuildChannel>>

GetGuildEmojiAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<GuildEmoji> GetGuildEmojiAsync(ulong guildId, ulong emojiId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
emojiId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

GetGuildEmojisAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildEmoji>>

GetGuildIntegrationsAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<IReadOnlyList<Integration>> GetGuildIntegrationsAsync(ulong guildId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Integration>>

GetGuildInvitesAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<RestInvite>>

GetGuildOnboardingAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildOnboarding>

GetGuildPreviewAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildPreview>

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

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

Parameters

guildId ulong
days int
roles IEnumerable<ulong>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<int>

GetGuildRoleAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

GetGuildRolesAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Role>>

GetGuildScheduledEventAsync(ulong, ulong, bool, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
scheduledEventId ulong
withUserCount bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

GetGuildScheduledEventUsersAsync(ulong, ulong, OptionalGuildUsersPaginationProperties?, RestRequestProperties?)

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

Parameters

guildId ulong
scheduledEventId ulong
paginationProperties OptionalGuildUsersPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildScheduledEventUser>

GetGuildScheduledEventsAsync(ulong, bool, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
withUserCount bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildScheduledEvent>>

GetGuildStickerAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<GuildSticker> GetGuildStickerAsync(ulong guildId, ulong stickerId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
stickerId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

GetGuildStickersAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<GuildSticker>>

GetGuildTemplateAsync(string, RestRequestProperties?, CancellationToken)

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

Parameters

templateCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

GetGuildTemplatesAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<GuildTemplate>>

GetGuildThreadUserAsync(ulong, ulong, bool, RestRequestProperties?, CancellationToken)

Retrieves a thread member object for a user in the thread.

public Task<ThreadUser> GetGuildThreadUserAsync(ulong threadId, ulong userId, bool withGuildUser = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

threadId ulong

The ID of the thread.

userId ulong

The ID of the user to fetch thread membership info for.

withGuildUser bool

Whether to include full guild member info in the response.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<ThreadUser>

GetGuildThreadUsersAsync(ulong, OptionalGuildUsersPaginationProperties?, RestRequestProperties?)

Retrieves a list of users participating in a thread.

public IAsyncEnumerable<ThreadUser> GetGuildThreadUsersAsync(ulong threadId, OptionalGuildUsersPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

threadId ulong

The ID of the thread.

paginationProperties OptionalGuildUsersPaginationProperties

Pagination options for fetching users, or null to use defaults.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<ThreadUser>

GetGuildUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

GetGuildUserVoiceStateAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<VoiceState>

GetGuildUsersAsync(ulong, PaginationProperties<ulong>?, RestRequestProperties?)

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

Parameters

guildId ulong
paginationProperties PaginationProperties<ulong>
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildUser>

GetGuildVanityInviteAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildVanityInvite>

GetGuildVoiceRegionsAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<VoiceRegion>>

GetGuildWebhooksAsync(ulong, RestRequestProperties?, CancellationToken)

Retrieves a list of webhooks for the specified guild ID.

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

Parameters

guildId ulong

The ID of the guild to retrieve webhooks for.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<Webhook>>

GetGuildWelcomeScreenAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWelcomeScreen>

GetGuildWidgetAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidget>

GetGuildWidgetSettingsAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidgetSettings>

GetInteractionFollowupMessageAsync(ulong, string, ulong, RestRequestProperties?, CancellationToken)

public Task<RestMessage> GetInteractionFollowupMessageAsync(ulong applicationId, string interactionToken, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
messageId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

GetInteractionResponseAsync(ulong, string, RestRequestProperties?, CancellationToken)

public Task<RestMessage> GetInteractionResponseAsync(ulong applicationId, string interactionToken, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

GetInviteAsync(string, bool, bool, ulong?, RestRequestProperties?, CancellationToken)

public Task<RestInvite> GetInviteAsync(string inviteCode, bool withCounts = false, bool withExpiration = false, ulong? guildScheduledEventId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

inviteCode string
withCounts bool
withExpiration bool
guildScheduledEventId ulong?
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestInvite>

GetInviteTargetUsersAsync(string, RestRequestProperties?, CancellationToken)

public IAsyncEnumerable<ulong> GetInviteTargetUsersAsync(string inviteCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

inviteCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

IAsyncEnumerable<ulong>

GetInviteTargetUsersJobStatusAsync(string, RestRequestProperties?, CancellationToken)

public Task<InviteTargetUsersJobStatus> GetInviteTargetUsersJobStatusAsync(string inviteCode, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

inviteCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<InviteTargetUsersJobStatus>

GetJoinedPrivateArchivedGuildThreadsAsync(ulong, PaginationProperties<ulong>?, RestRequestProperties?)

Retrieves private archived threads joined by the current user.

public IAsyncEnumerable<GuildThread> GetJoinedPrivateArchivedGuildThreadsAsync(ulong channelId, PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the text channel.

paginationProperties PaginationProperties<ulong>

Pagination options for archived threads, or null to use defaults.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<GuildThread>

GetMessageAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Retrieves a message from a channel by its ID.

public Task<RestMessage> GetMessageAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to retrieve.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

GetMessagePollAnswerVotersAsync(ulong, ulong, int, PaginationProperties<ulong>?, RestRequestProperties?)

public IAsyncEnumerable<User> GetMessagePollAnswerVotersAsync(ulong channelId, ulong messageId, int answerId, PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong
messageId ulong
answerId int
paginationProperties PaginationProperties<ulong>
properties RestRequestProperties

Returns

IAsyncEnumerable<User>

GetMessageReactionsAsync(ulong, ulong, ReactionEmojiProperties, MessageReactionsPaginationProperties?, RestRequestProperties?)

Retrieves a paginated list of users who reacted to a message with a specific emoji.

public IAsyncEnumerable<User> GetMessageReactionsAsync(ulong channelId, ulong messageId, ReactionEmojiProperties emoji, MessageReactionsPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to retrieve reactions for.

emoji ReactionEmojiProperties

The emoji to filter reactions by.

paginationProperties MessageReactionsPaginationProperties

Pagination options for fetching users, or null to use defaults.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<User>

GetMessagesAroundAsync(ulong, ulong, int?, RestRequestProperties?, CancellationToken)

Retrieves a list of messages around a specific message ID within a channel.

public Task<IReadOnlyList<RestMessage>> GetMessagesAroundAsync(ulong channelId, ulong messageId, int? limit = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to retrieve messages from.

messageId ulong

The ID of the message to center the result around.

limit int?

The maximum number of messages to retrieve, or null to use the default.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<RestMessage>>

GetMessagesAsync(ulong, PaginationProperties<ulong>?, RestRequestProperties?)

Retrieves an IAsyncEnumerable<T>, representing the messages of a specific channel.

public IAsyncEnumerable<RestMessage> GetMessagesAsync(ulong channelId, PaginationProperties<ulong>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the channel to retrieve messages from.

paginationProperties PaginationProperties<ulong>

Optional properties to customize result pagination, can be null.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<RestMessage>

GetPrivateArchivedGuildThreadsAsync(ulong, PaginationProperties<DateTimeOffset>?, RestRequestProperties?)

Retrieves private archived threads in the channel.

public IAsyncEnumerable<GuildThread> GetPrivateArchivedGuildThreadsAsync(ulong channelId, PaginationProperties<DateTimeOffset>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the text channel.

paginationProperties PaginationProperties<DateTimeOffset>

Pagination options for archived threads, or null to use defaults.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<GuildThread>

GetPublicArchivedGuildThreadsAsync(ulong, PaginationProperties<DateTimeOffset>?, RestRequestProperties?)

Retrieves public archived threads in the channel.

public IAsyncEnumerable<GuildThread> GetPublicArchivedGuildThreadsAsync(ulong channelId, PaginationProperties<DateTimeOffset>? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

channelId ulong

The ID of the text channel.

paginationProperties PaginationProperties<DateTimeOffset>

Pagination options for archived threads, or null to use defaults.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<GuildThread>

GetSkuSubscriptionAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

public Task<Subscription> GetSkuSubscriptionAsync(ulong skuId, ulong subscriptionId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

skuId ulong
subscriptionId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Subscription>

GetSkuSubscriptionsAsync(ulong, SubscriptionPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<Subscription> GetSkuSubscriptionsAsync(ulong skuId, SubscriptionPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

skuId ulong
paginationProperties SubscriptionPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<Subscription>

GetSkusAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

applicationId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Sku>>

GetStageInstanceAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<StageInstance> GetStageInstanceAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<StageInstance>

GetStickerAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<StandardSticker> GetStickerAsync(ulong stickerId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

stickerId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<StandardSticker>

GetStickerPackAsync(ulong, RestRequestProperties?, CancellationToken)

public Task<StickerPack> GetStickerPackAsync(ulong stickerPackId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

stickerPackId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<StickerPack>

GetStickerPacksAsync(RestRequestProperties?, CancellationToken)

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

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<StickerPack>>

GetUserAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<User>

GetVoiceRegionsAsync(RestRequestProperties?, CancellationToken)

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

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IEnumerable<VoiceRegion>>

GetWebhookAsync(ulong, RestRequestProperties?, CancellationToken)

Retrieves a Webhook object for the given ID.

public Task<Webhook> GetWebhookAsync(ulong webhookId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to retrieve.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Webhook>

GetWebhookMessageAsync(ulong, string, ulong, ulong?, RestRequestProperties?, CancellationToken)

Returns a previously-sent webhook message.

public Task<RestMessage> GetWebhookMessageAsync(ulong webhookId, string webhookToken, ulong messageId, ulong? threadId = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to retrieve the message from.

webhookToken string

The token to use for authorization.

messageId ulong

The ID of the message to retrieve.

threadId ulong?

The ID of the thread the message is in.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

GetWebhookWithTokenAsync(ulong, string, RestRequestProperties?, CancellationToken)

Retrieves a Webhook object for the given ID, using the specified webhook token.

public Task<Webhook> GetWebhookWithTokenAsync(ulong webhookId, string webhookToken, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to retrieve.

webhookToken string

The token to use for authorization.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Webhook>

Remarks

This endpoint does not require authentication.

GroupDMChannelAddUserAsync(ulong, ulong, GroupDMChannelUserAddProperties, RestRequestProperties?, CancellationToken)

Adds a recipient to a group DM channel.

public Task GroupDMChannelAddUserAsync(ulong channelId, ulong userId, GroupDMChannelUserAddProperties groupDMChannelUserAddProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the group DM channel.

userId ulong

The ID of the user to add.

groupDMChannelUserAddProperties GroupDMChannelUserAddProperties

Properties for adding the user, such as access tokens.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

GroupDMChannelDeleteUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Removes a recipient from a group DM channel.

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

Parameters

channelId ulong

The ID of the group DM channel.

userId ulong

The ID of the user to remove.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

GuildPruneAsync(ulong, GuildPruneProperties, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
pruneProperties GuildPruneProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<int?>

JoinGuildThreadAsync(ulong, RestRequestProperties?, CancellationToken)

Joins the current user to a thread.

public Task JoinGuildThreadAsync(ulong threadId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

threadId ulong

The ID of the thread to join.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

KickGuildUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

LeaveGuildAsync(ulong, RestRequestProperties?, CancellationToken)

public Task LeaveGuildAsync(ulong guildId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

LeaveGuildThreadAsync(ulong, RestRequestProperties?, CancellationToken)

Removes the current user from a thread.

public Task LeaveGuildThreadAsync(ulong threadId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

threadId ulong

The ID of the thread to leave.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

ModifyApplicationEmojiAsync(ulong, ulong, Action<ApplicationEmojiOptions>, RestRequestProperties?, CancellationToken)

public Task<ApplicationEmoji> ModifyApplicationEmojiAsync(ulong applicationId, ulong emojiId, Action<ApplicationEmojiOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
emojiId ulong
action Action<ApplicationEmojiOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationEmoji>

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

Modifies a pre-existing auto-moderation rule for a specified guild.

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

Parameters

guildId ulong

The ID of the guild to modify the rule for.

autoModerationRuleId ulong

The ID of the rule to modify.

action Action<AutoModerationRuleOptions>

An action, representing the modifications to make to the rule.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<AutoModerationRule>

ModifyCurrentApplicationAsync(Action<CurrentApplicationOptions>, RestRequestProperties?, CancellationToken)

Modifies the application associated with the current user.

public Task<CurrentApplication> ModifyCurrentApplicationAsync(Action<CurrentApplicationOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<CurrentApplicationOptions>

An action representing the modification to be made.

properties RestRequestProperties

Optional properties to customize the REST request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes..

Returns

Task<CurrentApplication>

ModifyCurrentGuildUserAsync(ulong, Action<CurrentGuildUserOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<CurrentGuildUserOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

ModifyCurrentGuildUserVoiceStateAsync(ulong, Action<CurrentUserVoiceStateOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<CurrentUserVoiceStateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

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

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

Parameters

action Action<CurrentUserOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<CurrentUser>

ModifyGlobalApplicationCommandAsync(ulong, ulong, Action<ApplicationCommandOptions>, RestRequestProperties?, CancellationToken)

public Task<ApplicationCommand> ModifyGlobalApplicationCommandAsync(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<ApplicationCommand>

ModifyGroupDMChannelAsync(ulong, Action<GroupDMChannelOptions>, RestRequestProperties?, CancellationToken)

Modifies a group DM channel's properties.

public Task<Channel> ModifyGroupDMChannelAsync(ulong channelId, Action<GroupDMChannelOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the group DM channel to modify.

action Action<GroupDMChannelOptions>

An action delegate used to configure the channel's updated properties.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Channel>

ModifyGuildApplicationCommandAsync(ulong, ulong, ulong, Action<ApplicationCommandOptions>, RestRequestProperties?, CancellationToken)

public Task<GuildApplicationCommand> ModifyGuildApplicationCommandAsync(ulong applicationId, ulong guildId, ulong commandId, Action<ApplicationCommandOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
guildId ulong
commandId ulong
action Action<ApplicationCommandOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildApplicationCommand>

ModifyGuildAsync(ulong, Action<GuildOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<GuildOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestGuild>

ModifyGuildChannelAsync(ulong, Action<GuildChannelOptions>, RestRequestProperties?, CancellationToken)

Modifies a guild channel's properties.

public Task<Channel> ModifyGuildChannelAsync(ulong channelId, Action<GuildChannelOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the guild channel to modify.

action Action<GuildChannelOptions>

An action delegate used to configure the updated channel options.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Channel>

ModifyGuildChannelPermissionsAsync(ulong, PermissionOverwriteProperties, RestRequestProperties?, CancellationToken)

Modifies the permissions of a role or user in a guild channel.

public Task ModifyGuildChannelPermissionsAsync(ulong channelId, PermissionOverwriteProperties permissionOverwrite, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the guild channel to update permissions for.

permissionOverwrite PermissionOverwriteProperties

The permission overwrite to apply.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

ModifyGuildChannelPositionsAsync(ulong, IEnumerable<GuildChannelPositionProperties>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
positions IEnumerable<GuildChannelPositionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

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

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

Parameters

guildId ulong
emojiId ulong
action Action<GuildEmojiOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildEmoji>

ModifyGuildMfaLevelAsync(ulong, MfaLevel, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
mfaLevel MfaLevel
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<MfaLevel>

ModifyGuildOnboardingAsync(ulong, Action<GuildOnboardingOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<GuildOnboardingOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildOnboarding>

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

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

Parameters

guildId ulong
roleId ulong
action Action<RoleOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

ModifyGuildRolePositionsAsync(ulong, IEnumerable<RolePositionProperties>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
positions IEnumerable<RolePositionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<Role>>

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

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

Parameters

guildId ulong
scheduledEventId ulong
action Action<GuildScheduledEventOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildScheduledEvent>

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

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

Parameters

guildId ulong
stickerId ulong
action Action<GuildStickerOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildSticker>

ModifyGuildTemplateAsync(ulong, string, Action<GuildTemplateOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
templateCode string
action Action<GuildTemplateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

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

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

Parameters

guildId ulong
userId ulong
action Action<GuildUserOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildUser>

ModifyGuildUserVoiceStateAsync(ulong, ulong, ulong, Action<VoiceStateOptions>, RestRequestProperties?, CancellationToken)

public Task ModifyGuildUserVoiceStateAsync(ulong guildId, ulong channelId, ulong userId, Action<VoiceStateOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

guildId ulong
channelId ulong
userId ulong
action Action<VoiceStateOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

ModifyGuildWelcomeScreenAsync(ulong, Action<GuildWelcomeScreenOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<GuildWelcomeScreenOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWelcomeScreen>

ModifyGuildWidgetSettingsAsync(ulong, Action<GuildWidgetSettingsOptions>, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
action Action<GuildWidgetSettingsOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildWidgetSettings>

ModifyInteractionFollowupMessageAsync(ulong, string, ulong, Action<MessageOptions>, RestRequestProperties?, CancellationToken)

public Task<RestMessage> ModifyInteractionFollowupMessageAsync(ulong applicationId, string interactionToken, ulong messageId, Action<MessageOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
messageId ulong
action Action<MessageOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

ModifyInteractionResponseAsync(ulong, string, Action<MessageOptions>, RestRequestProperties?, CancellationToken)

public Task<RestMessage> ModifyInteractionResponseAsync(ulong applicationId, string interactionToken, Action<MessageOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
action Action<MessageOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

ModifyMessageAsync(ulong, ulong, Action<MessageOptions>, RestRequestProperties?, CancellationToken)

Modifies the properties of a specific message.

public Task<RestMessage> ModifyMessageAsync(ulong channelId, ulong messageId, Action<MessageOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to modify.

action Action<MessageOptions>

An action that sets the new message properties.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

ModifyStageInstanceAsync(ulong, Action<StageInstanceOptions>, RestRequestProperties?, CancellationToken)

public Task<StageInstance> ModifyStageInstanceAsync(ulong channelId, Action<StageInstanceOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong
action Action<StageInstanceOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<StageInstance>

ModifyWebhookAsync(ulong, Action<WebhookOptions>, RestRequestProperties?, CancellationToken)

Modifies a webhook, returning the updated Webhook object on success.

public Task<Webhook> ModifyWebhookAsync(ulong webhookId, Action<WebhookOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to modify.

action Action<WebhookOptions>

The modification to perform on the webhook.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Webhook>

Remarks

Requires the ManageWebhooks permission, and fires a WebhooksUpdate event.

ModifyWebhookMessageAsync(ulong, string, ulong, Action<MessageOptions>, ulong?, bool, RestRequestProperties?, CancellationToken)

Modifies a previously-sent webhook message.

public Task<RestMessage> ModifyWebhookMessageAsync(ulong webhookId, string webhookToken, ulong messageId, Action<MessageOptions> action, ulong? threadId = null, bool withComponents = true, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to modify the message with.

webhookToken string

The token to use for authorization.

messageId ulong

The ID of the message to modify.

action Action<MessageOptions>

The modification to apply to the message.

threadId ulong?

The ID of the thread the message is in.

withComponents bool

Whether to respect the modification's Components.

When enabled, allows application-owned webhooks to use all components, and non-owned webhooks to use non-interactive components.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

ModifyWebhookWithTokenAsync(ulong, string, Action<WebhookOptions>, RestRequestProperties?, CancellationToken)

Modifies a webhook using the specified token, returning the updated Webhook object on success.

public Task<Webhook> ModifyWebhookWithTokenAsync(ulong webhookId, string webhookToken, Action<WebhookOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookId ulong

The ID of the webhook to modify.

webhookToken string

The token to use for authorization.

action Action<WebhookOptions>

The modification to perform on the webhook.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<Webhook>

Remarks

Requires the ManageWebhooks permission, and fires a WebhooksUpdate event.

Does not allow modifiying the ChannelId property.

OverwriteApplicationCommandGuildPermissionsAsync(ulong, ulong, ulong, IEnumerable<ApplicationCommandGuildPermissionProperties>, RestRequestProperties?, CancellationToken)

public Task<ApplicationCommandGuildPermissions> OverwriteApplicationCommandGuildPermissionsAsync(ulong applicationId, ulong guildId, ulong commandId, IEnumerable<ApplicationCommandGuildPermissionProperties> newPermissions, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
guildId ulong
commandId ulong
newPermissions IEnumerable<ApplicationCommandGuildPermissionProperties>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationCommandGuildPermissions>

PinMessageAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Pins a message in a channel.

public Task PinMessageAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to pin.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

Remarks

Requires the PinMessages permission. Fires a ChannelPinsUpdate event.

RemoveGuildUserRoleAsync(ulong, ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

SearchGuildMessagesAsync(ulong, GuildMessagesSearchPaginationProperties?, RestRequestProperties?)

Performs a search within a guild according to a set of specified filters.

public IAsyncEnumerable<GuildMessageSearchResult> SearchGuildMessagesAsync(ulong guildId, GuildMessagesSearchPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

guildId ulong

The ID of the guild to search through.

paginationProperties GuildMessagesSearchPaginationProperties

Optional properties to customize result pagination and filtering, can be null.

properties RestRequestProperties

Optional properties to customize each request, can be null.

Returns

IAsyncEnumerable<GuildMessageSearchResult>

SearchGuildUsersAsync(ulong, GuildUsersSearchPaginationProperties?, RestRequestProperties?)

public IAsyncEnumerable<GuildUserInfo> SearchGuildUsersAsync(ulong guildId, GuildUsersSearchPaginationProperties? paginationProperties = null, RestRequestProperties? properties = null)

Parameters

guildId ulong
paginationProperties GuildUsersSearchPaginationProperties
properties RestRequestProperties

Returns

IAsyncEnumerable<GuildUserInfo>

SendInteractionFollowupMessageAsync(ulong, string, InteractionMessageProperties, RestRequestProperties?, CancellationToken)

public Task<RestMessage> SendInteractionFollowupMessageAsync(ulong applicationId, string interactionToken, InteractionMessageProperties message, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
interactionToken string
message InteractionMessageProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<RestMessage>

SendInteractionResponseAsync(ulong, string, InteractionCallbackProperties, bool, RestRequestProperties?, CancellationToken)

public Task<InteractionCallbackResponse?> SendInteractionResponseAsync(ulong interactionId, string interactionToken, InteractionCallbackProperties callback, bool withResponse = false, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

interactionId ulong
interactionToken string
callback InteractionCallbackProperties
withResponse bool
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<InteractionCallbackResponse>

SendMessageAsync(ulong, MessageProperties, RestRequestProperties?, CancellationToken)

Sends a new message to the specified text channel.

public Task<RestMessage> SendMessageAsync(ulong channelId, MessageProperties message, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to send the message to.

message MessageProperties

The content and properties of the message to send.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestMessage>

SendRequestAsync(HttpMethod, FormattableString, string?, TopLevelResourceInfo?, RestRequestProperties?, bool, CancellationToken)

public Task<Stream> SendRequestAsync(HttpMethod method, FormattableString route, string? query = null, TopLevelResourceInfo? resourceInfo = null, RestRequestProperties? properties = null, bool global = true, CancellationToken cancellationToken = default)

Parameters

method HttpMethod
route FormattableString
query string
resourceInfo TopLevelResourceInfo?
properties RestRequestProperties
global bool
cancellationToken CancellationToken

Returns

Task<Stream>

SendRequestAsync(HttpMethod, HttpContent, FormattableString, string?, TopLevelResourceInfo?, RestRequestProperties?, bool, CancellationToken)

public Task<Stream> SendRequestAsync(HttpMethod method, HttpContent content, FormattableString route, string? query = null, TopLevelResourceInfo? resourceInfo = null, RestRequestProperties? properties = null, bool global = true, CancellationToken cancellationToken = default)

Parameters

method HttpMethod
content HttpContent
route FormattableString
query string
resourceInfo TopLevelResourceInfo?
properties RestRequestProperties
global bool
cancellationToken CancellationToken

Returns

Task<Stream>

SetVoiceGuildChannelStatusAsync(ulong, VoiceGuildChannelStatusProperties, RestRequestProperties?, CancellationToken)

Sets a guild voice channel's status.

public Task SetVoiceGuildChannelStatusAsync(ulong channelId, VoiceGuildChannelStatusProperties statusProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the guild voice channel to update.

statusProperties VoiceGuildChannelStatusProperties

The status to apply to the channel.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

SyncGuildTemplateAsync(ulong, string, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
templateCode string
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<GuildTemplate>

TriggerTypingAsync(ulong, RestRequestProperties?, CancellationToken)

Sends a typing indicator to a channel.

public Task TriggerTypingAsync(ulong channelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel to trigger typing in.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

UnbanGuildUserAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

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

Parameters

guildId ulong
userId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

UnpinMessageAsync(ulong, ulong, RestRequestProperties?, CancellationToken)

Unpins a message from a channel.

public Task UnpinMessageAsync(ulong channelId, ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

channelId ulong

The ID of the channel containing the message.

messageId ulong

The ID of the message to unpin.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

Remarks

Requires the PinMessages permission. Fires a ChannelPinsUpdate event.

UpdateApplicationRoleConnectionMetadataRecordsAsync(ulong, IEnumerable<ApplicationRoleConnectionMetadataProperties>, RestRequestProperties?, CancellationToken)

Updates an application's ApplicationRoleConnectionMetadata list, replacing it with the given list instead.

public Task<IReadOnlyList<ApplicationRoleConnectionMetadata>> UpdateApplicationRoleConnectionMetadataRecordsAsync(ulong applicationId, IEnumerable<ApplicationRoleConnectionMetadataProperties> applicationRoleConnectionMetadataProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong

The ID of the application to modify data for.

applicationRoleConnectionMetadataProperties IEnumerable<ApplicationRoleConnectionMetadataProperties>

The list to overwrite the target data with.

properties RestRequestProperties

Optional properties to customize the REST request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes..

Returns

Task<IReadOnlyList<ApplicationRoleConnectionMetadata>>

UpdateCurrentUserApplicationRoleConnectionAsync(ulong, ApplicationRoleConnectionProperties, RestRequestProperties?, CancellationToken)

public Task<ApplicationRoleConnection> UpdateCurrentUserApplicationRoleConnectionAsync(ulong applicationId, ApplicationRoleConnectionProperties applicationRoleConnectionProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

applicationId ulong
applicationRoleConnectionProperties ApplicationRoleConnectionProperties
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<ApplicationRoleConnection>

UpdateInviteTargetUsersAsync(string, InviteTargetUsersProperties, RestRequestProperties?, CancellationToken)

public Task UpdateInviteTargetUsersAsync(string inviteCode, InviteTargetUsersProperties inviteTargetUsersProperties, RestRequestProperties? requestProperties = null, CancellationToken cancellationToken = default)

Parameters

inviteCode string
inviteTargetUsersProperties InviteTargetUsersProperties
requestProperties RestRequestProperties
cancellationToken CancellationToken

Returns

Task