Class DiscordRestClient
Provides a client to send REST-based requests to Discord.
Assembly: Discord.Net.Rest.dll​
View Source​
public class DiscordRestClient : BaseDiscordClient, IDiscordClient, IDisposable
Properties​
CurrentUser​
Gets the logged-in user.
View Source​
public RestSelfUser CurrentUser { get; }
Methods​
IsValidHttpInteraction(String, String, String, String)​
View Source​
public bool IsValidHttpInteraction(string publicKey, string signature, string timestamp, string body)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
System.String | publicKey |
System.String | signature |
System.String | timestamp |
System.String | body |
IsValidHttpInteraction(String, String, String, Byte[])​
View Source​
public bool IsValidHttpInteraction(string publicKey, string signature, string timestamp, byte[] body)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
System.String | publicKey |
System.String | signature |
System.String | timestamp |
System.Byte[] | body |
ParseHttpInteractionAsync(String, String, String, String)​
Creates a Discord.Rest.RestInteraction from a http message.
View Source​
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​
Type | Name | Description |
---|---|---|
System.String | publicKey | The public key of your application |
System.String | signature | The signature sent with the interaction. |
System.String | timestamp | The timestamp sent with the interaction. |
System.String | body | The body of the http message. |
ParseHttpInteractionAsync(String, String, String, Byte[])​
Creates a Discord.Rest.RestInteraction from a http message.
View Source​
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​
Type | Name | Description |
---|---|---|
System.String | publicKey | The public key of your application |
System.String | signature | The signature sent with the interaction. |
System.String | timestamp | The timestamp sent with the interaction. |
System.Byte[] | body | The body of the http message. |
GetApplicationInfoAsync(RequestOptions)​
View Source​
public async Task<RestApplication> GetApplicationInfoAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestApplication>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetChannelAsync(UInt64, RequestOptions)​
View Source​
public Task<RestChannel> GetChannelAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestChannel>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
Discord.RequestOptions | options |
GetPrivateChannelsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<IRestPrivateChannel>> GetPrivateChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.IRestPrivateChannel>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetDMChannelsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestDMChannel>> GetDMChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestDMChannel>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetGroupChannelsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGroupChannel>> GetGroupChannelsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGroupChannel>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetConnectionsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestConnection>> GetConnectionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestConnection>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetInviteAsync(String, RequestOptions)​
View Source​
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestInviteMetadata>
Parameters​
Type | Name |
---|---|
System.String | inviteId |
Discord.RequestOptions | options |
GetGuildAsync(UInt64, RequestOptions)​
View Source​
public Task<RestGuild> GetGuildAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuild>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
Discord.RequestOptions | options |
GetGuildAsync(UInt64, Boolean, RequestOptions)​
View Source​
public Task<RestGuild> GetGuildAsync(ulong id, bool withCounts, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuild>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
System.Boolean | withCounts |
Discord.RequestOptions | options |
GetGuildWidgetAsync(UInt64, RequestOptions)​
View Source​
public Task<RestGuildWidget?> GetGuildWidgetAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Nullable<Discord.Rest.RestGuildWidget>>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
Discord.RequestOptions | options |
GetGuildSummariesAsync(RequestOptions)​
View Source​
public IAsyncEnumerable<IReadOnlyCollection<RestUserGuild>> GetGuildSummariesAsync(RequestOptions options = null)
Returns​
System.Collections.Generic.IAsyncEnumerable<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestUserGuild>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetGuildSummariesAsync(UInt64, Int32, RequestOptions)​
View Source​
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​
Type | Name |
---|---|
System.UInt64 | fromGuildId |
System.Int32 | limit |
Discord.RequestOptions | options |
GetGuildsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGuild>> GetGuildsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuild>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetGuildsAsync(Boolean, RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGuild>> GetGuildsAsync(bool withCounts, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuild>>
Parameters​
Type | Name |
---|---|
System.Boolean | withCounts |
Discord.RequestOptions | options |
CreateGuildAsync(String, IVoiceRegion, Stream, RequestOptions)​
View Source​
public Task<RestGuild> CreateGuildAsync(string name, IVoiceRegion region, Stream jpegIcon = null, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuild>
Parameters​
Type | Name |
---|---|
System.String | name |
Discord.IVoiceRegion | region |
System.IO.Stream | jpegIcon |
Discord.RequestOptions | options |
GetUserAsync(UInt64, RequestOptions)​
View Source​
public Task<RestUser> GetUserAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestUser>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
Discord.RequestOptions | options |
GetGuildUserAsync(UInt64, UInt64, RequestOptions)​
View Source​
public Task<RestGuildUser> GetGuildUserAsync(ulong guildId, ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildUser>
Parameters​
Type | Name |
---|---|
System.UInt64 | guildId |
System.UInt64 | id |
Discord.RequestOptions | options |
GetVoiceRegionsAsync(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestVoiceRegion>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetVoiceRegionAsync(String, RequestOptions)​
View Source​
public Task<RestVoiceRegion> GetVoiceRegionAsync(string id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestVoiceRegion>
Parameters​
Type | Name |
---|---|
System.String | id |
Discord.RequestOptions | options |
GetWebhookAsync(UInt64, RequestOptions)​
View Source​
public Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestWebhook>
Parameters​
Type | Name |
---|---|
System.UInt64 | id |
Discord.RequestOptions | options |
CreateGlobalCommand(ApplicationCommandProperties, RequestOptions)​
View Source​
public Task<RestGlobalCommand> CreateGlobalCommand(ApplicationCommandProperties properties, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGlobalCommand>
Parameters​
Type | Name |
---|---|
Discord.ApplicationCommandProperties | properties |
Discord.RequestOptions | options |
CreateGuildCommand(ApplicationCommandProperties, UInt64, RequestOptions)​
View Source​
public Task<RestGuildCommand> CreateGuildCommand(ApplicationCommandProperties properties, ulong guildId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<Discord.Rest.RestGuildCommand>
Parameters​
Type | Name |
---|---|
Discord.ApplicationCommandProperties | properties |
System.UInt64 | guildId |
Discord.RequestOptions | options |
GetGlobalApplicationCommands(RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGlobalCommand>> GetGlobalApplicationCommands(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGlobalCommand>>
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
GetGuildApplicationCommands(UInt64, RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGuildCommand>> GetGuildApplicationCommands(ulong guildId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGuildCommand>>
Parameters​
Type | Name |
---|---|
System.UInt64 | guildId |
Discord.RequestOptions | options |
BulkOverwriteGlobalCommands(ApplicationCommandProperties[], RequestOptions)​
View Source​
public Task<IReadOnlyCollection<RestGlobalCommand>> BulkOverwriteGlobalCommands(ApplicationCommandProperties[] commandProperties, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<Discord.Rest.RestGlobalCommand>>
Parameters​
Type | Name |
---|---|
Discord.ApplicationCommandProperties[] | commandProperties |
Discord.RequestOptions | options |
BulkOverwriteGuildCommands(ApplicationCommandProperties[], UInt64, RequestOptions)​
View Source​
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​
Type | Name |
---|---|
Discord.ApplicationCommandProperties[] | commandProperties |
System.UInt64 | guildId |
Discord.RequestOptions | options |
BatchEditGuildCommandPermissions(UInt64, IDictionary<UInt64, ApplicationCommandPermission[]>, RequestOptions)​
View Source​
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​
Type | Name |
---|---|
System.UInt64 | guildId |
System.Collections.Generic.IDictionary<System.UInt64,Discord.ApplicationCommandPermission[]> | permissions |
Discord.RequestOptions | options |
DeleteAllGlobalCommandsAsync(RequestOptions)​
View Source​
public Task DeleteAllGlobalCommandsAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
Discord.RequestOptions | options |
AddRoleAsync(UInt64, UInt64, UInt64)​
View Source​
public Task AddRoleAsync(ulong guildId, ulong userId, ulong roleId)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | guildId |
System.UInt64 | userId |
System.UInt64 | roleId |
RemoveRoleAsync(UInt64, UInt64, UInt64)​
View Source​
public Task RemoveRoleAsync(ulong guildId, ulong userId, ulong roleId)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | guildId |
System.UInt64 | userId |
System.UInt64 | roleId |
AddReactionAsync(UInt64, UInt64, IEmote, RequestOptions)​
View Source​
public Task AddReactionAsync(ulong channelId, ulong messageId, IEmote emote, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | channelId |
System.UInt64 | messageId |
Discord.IEmote | emote |
Discord.RequestOptions | options |
RemoveReactionAsync(UInt64, UInt64, UInt64, IEmote, RequestOptions)​
View Source​
public Task RemoveReactionAsync(ulong channelId, ulong messageId, ulong userId, IEmote emote, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | channelId |
System.UInt64 | messageId |
System.UInt64 | userId |
Discord.IEmote | emote |
Discord.RequestOptions | options |
RemoveAllReactionsAsync(UInt64, UInt64, RequestOptions)​
View Source​
public Task RemoveAllReactionsAsync(ulong channelId, ulong messageId, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | channelId |
System.UInt64 | messageId |
Discord.RequestOptions | options |
RemoveAllReactionsForEmoteAsync(UInt64, UInt64, IEmote, RequestOptions)​
View Source​
public Task RemoveAllReactionsForEmoteAsync(ulong channelId, ulong messageId, IEmote emote, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name |
---|---|
System.UInt64 | channelId |
System.UInt64 | messageId |
Discord.IEmote | emote |
Discord.RequestOptions | options |
IDiscordClient.GetApplicationInfoAsync(RequestOptions)​
Gets a Discord application information for the logged-in user.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetChannelAsync(UInt64, CacheMode, RequestOptions)​
Gets a generic channel.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the channel (e.g. 381889909113225237 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetPrivateChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of private channels opened in this session.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetGroupChannelsAsync(CacheMode, RequestOptions)​
Gets a collection of group channels opened in this session.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetConnectionsAsync(RequestOptions)​
Gets the connections that the user has set up.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetInviteAsync(String, RequestOptions)​
View Source​
async Task<IInvite> IDiscordClient.GetInviteAsync(string inviteId, RequestOptions options)
Returns​
System.Threading.Tasks.Task<Discord.IInvite>
Parameters​
Type | Name |
---|---|
System.String | inviteId |
Discord.RequestOptions | options |
IDiscordClient.GetGuildAsync(UInt64, CacheMode, RequestOptions)​
Gets a guild.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The guild snowflake identifier. |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The 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​
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​
Type | Name | Description |
---|---|---|
System.String | name | The name of the new guild. |
Discord.IVoiceRegion | region | The voice region to create the guild with. |
System.IO.Stream | jpegIcon | The icon of the guild. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetUserAsync(UInt64, CacheMode, RequestOptions)​
Gets a user.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The snowflake identifier of the user (e.g. 168693960628371456 ). |
Discord.CacheMode | mode | The Discord.CacheMode that determines whether the object should be fetched from cache. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetVoiceRegionsAsync(RequestOptions)​
Gets a collection of the available voice regions.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetVoiceRegionAsync(String, RequestOptions)​
Gets a voice region.
View Source​
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​
Type | Name | Description |
---|---|---|
System.String | id | The identifier of the voice region (e.g. eu-central ). |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetWebhookAsync(UInt64, RequestOptions)​
Gets a webhook available.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The identifier of the webhook. |
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetGlobalApplicationCommandsAsync(RequestOptions)​
Gets a collection of all global commands.
View Source​
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​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
IDiscordClient.GetGlobalApplicationCommandAsync(UInt64, RequestOptions)​
Gets a global application command.
View Source​
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​
Type | Name | Description |
---|---|---|
System.UInt64 | id | The id of the command. |
Discord.RequestOptions | options | The options to be used when sending the request. |
Implements​
- Discord.IDiscordClient
System.IDisposable
Extension Methods​
- Discord.Rest.BaseDiscordClient.Discord.Rest.ClientExtensions.AddGuildUserAsync(System.UInt64,System.UInt64,System.String,System.Action{Discord.AddGuildUserProperties},Discord.RequestOptions)