Skip to main content

Class DiscordRestClient

Provides a client to send REST-based requests to Discord.

Assembly: Discord.Net.Rest.dll​
View Source​
Declaration
public class DiscordRestClient : BaseDiscordClient, IDiscordClient, IDisposable

Properties​

CurrentUser​

Gets the logged-in user.

View Source​
Declaration
public RestSelfUser CurrentUser { get; }

Methods​

IsValidHttpInteraction(String, String, String, String)​

View Source​
Declaration
public bool IsValidHttpInteraction(string publicKey, string signature, string timestamp, string body)
Returns​

System.Boolean

Parameters​
TypeName
System.StringpublicKey
System.Stringsignature
System.Stringtimestamp
System.Stringbody

IsValidHttpInteraction(String, String, String, Byte[])​

View Source​
Declaration
public bool IsValidHttpInteraction(string publicKey, string signature, string timestamp, byte[] body)
Returns​

System.Boolean

Parameters​
TypeName
System.StringpublicKey
System.Stringsignature
System.Stringtimestamp
System.Byte[]body

ParseHttpInteractionAsync(String, String, String, String)​

Creates a Discord.Rest.RestInteraction from a http message.

View Source​
Declaration
public Task<RestInteraction> ParseHttpInteractionAsync(string publicKey, string signature, string timestamp, string body)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestInteraction>: A Discord.Rest.RestInteraction that represents the incoming http interaction.

Parameters​
TypeNameDescription
System.StringpublicKeyThe public key of your application
System.StringsignatureThe signature sent with the interaction.
System.StringtimestampThe timestamp sent with the interaction.
System.StringbodyThe body of the http message.

ParseHttpInteractionAsync(String, String, String, Byte[])​

Creates a Discord.Rest.RestInteraction from a http message.

View Source​
Declaration
public async Task<RestInteraction> ParseHttpInteractionAsync(string publicKey, string signature, string timestamp, byte[] body)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestInteraction>: A Discord.Rest.RestInteraction that represents the incoming http interaction.

Parameters​
TypeNameDescription
System.StringpublicKeyThe public key of your application
System.StringsignatureThe signature sent with the interaction.
System.StringtimestampThe timestamp sent with the interaction.
System.Byte[]bodyThe body of the http message.

GetApplicationInfoAsync(RequestOptions)​

View Source​
Declaration
public async Task<RestApplication> GetApplicationInfoAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestApplication>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetChannelAsync(UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestChannel>

Parameters​
TypeName
System.UInt64id
Discord.RequestOptionsoptions

GetPrivateChannelsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<IRestPrivateChannel>> GetPrivateChannelsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.IRestPrivateChannel>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetDMChannelsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestDMChannel>> GetDMChannelsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestDMChannel>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetGroupChannelsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGroupChannel>> GetGroupChannelsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGroupChannel>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetConnectionsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestConnection>> GetConnectionsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestConnection>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetInviteAsync(String, RequestOptions)​

View Source​
Declaration
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestInviteMetadata>

Parameters​
TypeName
System.StringinviteId
Discord.RequestOptionsoptions

GetGuildAsync(UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestGuild> GetGuildAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuild>

Parameters​
TypeName
System.UInt64id
Discord.RequestOptionsoptions

GetGuildAsync(UInt64, Boolean, RequestOptions)​

View Source​
Declaration
public Task<RestGuild> GetGuildAsync(ulong id, bool withCounts, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuild>

Parameters​
TypeName
System.UInt64id
System.BooleanwithCounts
Discord.RequestOptionsoptions

GetGuildWidgetAsync(UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestGuildWidget?> GetGuildWidgetAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Nullable<Discord.Rest.RestGuildWidget>>

Parameters​
TypeName
System.UInt64id
Discord.RequestOptionsoptions

GetGuildSummariesAsync(RequestOptions)​

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestUserGuild>> GetGuildSummariesAsync(RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestUserGuild>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetGuildSummariesAsync(UInt64, Int32, RequestOptions)​

View Source​
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestUserGuild>> GetGuildSummariesAsync(ulong fromGuildId, int limit, RequestOptions options = null)
Returns​

System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestUserGuild>>

Parameters​
TypeName
System.UInt64fromGuildId
System.Int32limit
Discord.RequestOptionsoptions

GetGuildsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuild>> GetGuildsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuild>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetGuildsAsync(Boolean, RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuild>> GetGuildsAsync(bool withCounts, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuild>>

Parameters​
TypeName
System.BooleanwithCounts
Discord.RequestOptionsoptions

CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)​

View Source​
Declaration
public Task<RestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuild>

Parameters​
TypeName
System.Stringname
Discord.IVoiceRegionregion
System.IO.StreamjpegIcon
Discord.RequestOptionsoptions

GetUserAsync(UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestUser> GetUserAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestUser>

Parameters​
TypeName
System.UInt64id
Discord.RequestOptionsoptions

GetGuildUserAsync(UInt64, UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestGuildUser> GetGuildUserAsync(ulong guildId, ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>

Parameters​
TypeName
System.UInt64guildId
System.UInt64id
Discord.RequestOptionsoptions

GetVoiceRegionsAsync(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceRegion>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetVoiceRegionAsync(String, RequestOptions)​

View Source​
Declaration
public Task<RestVoiceRegion> GetVoiceRegionAsync(string id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestVoiceRegion>

Parameters​
TypeName
System.Stringid
Discord.RequestOptionsoptions

GetWebhookAsync(UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestWebhook>

Parameters​
TypeName
System.UInt64id
Discord.RequestOptionsoptions

CreateGlobalCommand(ApplicationCommandProperties, RequestOptions)​

View Source​
Declaration
public Task<RestGlobalCommand> CreateGlobalCommand(ApplicationCommandProperties properties, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGlobalCommand>

Parameters​
TypeName
Discord.ApplicationCommandPropertiesproperties
Discord.RequestOptionsoptions

CreateGuildCommand(ApplicationCommandProperties, UInt64, RequestOptions)​

View Source​
Declaration
public Task<RestGuildCommand> CreateGuildCommand(ApplicationCommandProperties properties, ulong guildId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestGuildCommand>

Parameters​
TypeName
Discord.ApplicationCommandPropertiesproperties
System.UInt64guildId
Discord.RequestOptionsoptions

GetGlobalApplicationCommands(RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGlobalCommand>> GetGlobalApplicationCommands(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGlobalCommand>>

Parameters​
TypeName
Discord.RequestOptionsoptions

GetGuildApplicationCommands(UInt64, RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuildCommand>> GetGuildApplicationCommands(ulong guildId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildCommand>>

Parameters​
TypeName
System.UInt64guildId
Discord.RequestOptionsoptions

BulkOverwriteGlobalCommands(ApplicationCommandProperties[], RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGlobalCommand>> BulkOverwriteGlobalCommands(ApplicationCommandProperties[] commandProperties, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGlobalCommand>>

Parameters​
TypeName
Discord.ApplicationCommandProperties[]commandProperties
Discord.RequestOptionsoptions

BulkOverwriteGuildCommands(ApplicationCommandProperties[], UInt64, RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<RestGuildCommand>> BulkOverwriteGuildCommands(ApplicationCommandProperties[] commandProperties, ulong guildId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildCommand>>

Parameters​
TypeName
Discord.ApplicationCommandProperties[]commandProperties
System.UInt64guildId
Discord.RequestOptionsoptions

BatchEditGuildCommandPermissions(UInt64, IDictionary<UInt64, ApplicationCommandPermission[]>, RequestOptions)​

View Source​
Declaration
public Task<IReadOnlyCollection<GuildApplicationCommandPermission>> BatchEditGuildCommandPermissions(ulong guildId, IDictionary<ulong, ApplicationCommandPermission[]> permissions, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.GuildApplicationCommandPermission>>

Parameters​
TypeName
System.UInt64guildId
System.Collections.Generic.IDictionary<System.UInt64,Discord.ApplicationCommandPermission[]>permissions
Discord.RequestOptionsoptions

DeleteAllGlobalCommandsAsync(RequestOptions)​

View Source​
Declaration
public Task DeleteAllGlobalCommandsAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
Discord.RequestOptionsoptions

AddRoleAsync(UInt64, UInt64, UInt64)​

View Source​
Declaration
public Task AddRoleAsync(ulong guildId, ulong userId, ulong roleId)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64guildId
System.UInt64userId
System.UInt64roleId

RemoveRoleAsync(UInt64, UInt64, UInt64)​

View Source​
Declaration
public Task RemoveRoleAsync(ulong guildId, ulong userId, ulong roleId)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64guildId
System.UInt64userId
System.UInt64roleId

AddReactionAsync(UInt64, UInt64, IEmote, RequestOptions)​

View Source​
Declaration
public Task AddReactionAsync(ulong channelId, ulong messageId, IEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64channelId
System.UInt64messageId
Discord.IEmoteemote
Discord.RequestOptionsoptions

RemoveReactionAsync(UInt64, UInt64, UInt64, IEmote, RequestOptions)​

View Source​
Declaration
public Task RemoveReactionAsync(ulong channelId, ulong messageId, ulong userId, IEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64channelId
System.UInt64messageId
System.UInt64userId
Discord.IEmoteemote
Discord.RequestOptionsoptions

RemoveAllReactionsAsync(UInt64, UInt64, RequestOptions)​

View Source​
Declaration
public Task RemoveAllReactionsAsync(ulong channelId, ulong messageId, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64channelId
System.UInt64messageId
Discord.RequestOptionsoptions

RemoveAllReactionsForEmoteAsync(UInt64, UInt64, IEmote, RequestOptions)​

View Source​
Declaration
public Task RemoveAllReactionsForEmoteAsync(ulong channelId, ulong messageId, IEmote emote, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeName
System.UInt64channelId
System.UInt64messageId
Discord.IEmoteemote
Discord.RequestOptionsoptions

IDiscordClient.GetApplicationInfoAsync(RequestOptions)​

Gets a Discord application information for the logged-in user.

View Source​
Declaration
async Task<IApplication> IDiscordClient.GetApplicationInfoAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IApplication>: A task that represents the asynchronous get operation. The task result contains the application information.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetChannelAsync(UInt64, CacheMode, RequestOptions)​

Gets a generic channel.

View Source​
Declaration
async Task<IChannel> IDiscordClient.GetChannelAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IChannel>: A task that represents the asynchronous get operation. The task result contains the channel associated with the snowflake identifier; null when the channel cannot be found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the channel (e.g. 381889909113225237).
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetPrivateChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of private channels opened in this session.

View Source​
Declaration
async Task<IReadOnlyCollection<IPrivateChannel>> IDiscordClient.GetPrivateChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IPrivateChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of private channels that the user currently partakes in.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetDMChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of direct message channels opened in this session.

View Source​
Declaration
async Task<IReadOnlyCollection<IDMChannel>> IDiscordClient.GetDMChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IDMChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of direct-message channels that the user currently partakes in.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetGroupChannelsAsync(CacheMode, RequestOptions)​

Gets a collection of group channels opened in this session.

View Source​
Declaration
async Task<IReadOnlyCollection<IGroupChannel>> IDiscordClient.GetGroupChannelsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGroupChannel>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of group channels that the user currently partakes in.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetConnectionsAsync(RequestOptions)​

Gets the connections that the user has set up.

View Source​
Declaration
async Task<IReadOnlyCollection<IConnection>> IDiscordClient.GetConnectionsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IConnection>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of connections.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetInviteAsync(String, RequestOptions)​

View Source​
Declaration
async Task<IInvite> IDiscordClient.GetInviteAsync(string inviteId, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IInvite>

Parameters​
TypeName
System.StringinviteId
Discord.RequestOptionsoptions

IDiscordClient.GetGuildAsync(UInt64, CacheMode, RequestOptions)​

Gets a guild.

View Source​
Declaration
async Task<IGuild> IDiscordClient.GetGuildAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuild>: A task that represents the asynchronous get operation. The task result contains the guild associated with the snowflake identifier; null when the guild cannot be found.

Parameters​
TypeNameDescription
System.UInt64idThe guild snowflake identifier.
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetGuildsAsync(CacheMode, RequestOptions)​

Gets a collection of guilds that the user is currently in.

View Source​
Declaration
async Task<IReadOnlyCollection<IGuild>> IDiscordClient.GetGuildsAsync(CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IGuild>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of guilds that the current user is in.

Parameters​
TypeNameDescription
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)​

Creates a guild for the logged-in user who is in less than 10 active guilds.

View Source​
Declaration
async Task<IGuild> IDiscordClient.CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IGuild>: A task that represents the asynchronous creation operation. The task result contains the created guild.

Parameters​
TypeNameDescription
System.StringnameThe name of the new guild.
Discord.IVoiceRegionregionThe voice region to create the guild with.
System.IO.StreamjpegIconThe icon of the guild.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetUserAsync(UInt64, CacheMode, RequestOptions)​

Gets a user.

View Source​
Declaration
async Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IUser>: A task that represents the asynchronous get operation. The task result contains the user associated with the snowflake identifier; null if the user is not found.

Parameters​
TypeNameDescription
System.UInt64idThe snowflake identifier of the user (e.g. 168693960628371456).
Discord.CacheModemodeThe Discord.CacheMode that determines whether the object should be fetched from cache.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetVoiceRegionsAsync(RequestOptions)​

Gets a collection of the available voice regions.

View Source​
Declaration
async Task<IReadOnlyCollection<IVoiceRegion>> IDiscordClient.GetVoiceRegionsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IVoiceRegion>>: A task that represents the asynchronous get operation. The task result contains a read-only collection with all of the available voice regions in this session.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetVoiceRegionAsync(String, RequestOptions)​

Gets a voice region.

View Source​
Declaration
async Task<IVoiceRegion> IDiscordClient.GetVoiceRegionAsync(string id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IVoiceRegion>: A task that represents the asynchronous get operation. The task result contains the voice region associated with the identifier; null if the voice region is not found.

Parameters​
TypeNameDescription
System.StringidThe identifier of the voice region (e.g. eu-central ).
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetWebhookAsync(UInt64, RequestOptions)​

Gets a webhook available.

View Source​
Declaration
async Task<IWebhook> IDiscordClient.GetWebhookAsync(ulong id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IWebhook>: A task that represents the asynchronous get operation. The task result contains a webhook associated with the identifier; null if the webhook is not found.

Parameters​
TypeNameDescription
System.UInt64idThe identifier of the webhook.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetGlobalApplicationCommandsAsync(RequestOptions)​

Gets a collection of all global commands.

View Source​
Declaration
async Task<IReadOnlyCollection<IApplicationCommand>> IDiscordClient.GetGlobalApplicationCommandsAsync(RequestOptions options)
Returns​

System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.IApplicationCommand>>: A task that represents the asynchronous get operation. The task result contains a read-only collection of global application commands.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

IDiscordClient.GetGlobalApplicationCommandAsync(UInt64, RequestOptions)​

Gets a global application command.

View Source​
Declaration
async Task<IApplicationCommand> IDiscordClient.GetGlobalApplicationCommandAsync(ulong id, RequestOptions options)
Returns​

System.Threading.Tasks.Task<Discord.IApplicationCommand>: A task that represents the asynchronous get operation. The task result contains the application command if found, otherwise null.

Parameters​
TypeNameDescription
System.UInt64idThe id of the command.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

Implements​

Extension Methods​

  • Discord.Rest.BaseDiscordClient.Discord.Rest.ClientExtensions.AddGuildUserAsync(System.UInt64,System.UInt64,System.String,System.Action{Discord.AddGuildUserProperties},Discord.RequestOptions)