Class DiscordHttpClient
Implements
Inherited Members
Namespace: Discore.Http
Assembly: Discore.dll
Syntax
public class DiscordHttpClient : IDisposable
Constructors
| Name | Description |
|---|---|
| DiscordHttpClient(string) |
Properties
| Name | Description |
|---|---|
| RetryWhenRateLimited | Gets or sets whether to resend requests that get rate-limited. |
Methods
| Name | Description |
|---|---|
| AddGuildMemberRole(DiscordGuildMember, DiscordRole) | Adds a role to a guild member. Requires ManageRoles. |
| AddGuildMemberRole(Snowflake, Snowflake, Snowflake) | Adds a role to a guild member. Requires ManageRoles. |
| AddPinnedChannelMessage(DiscordMessage) | Pins a message in a text channel. Requires ManageMessages. |
| AddPinnedChannelMessage(Snowflake, Snowflake) | Pins a message in a text channel. Requires ManageMessages. |
| BeginGuildPrune(DiscordGuild, int?, IEnumerable<DiscordRole>?, bool?) | Begins a member prune operation, kicking every member that has been offline for the specified number of days. Requires KickMembers. |
| BeginGuildPrune(Snowflake, int?, IEnumerable<Snowflake>?, bool?) | Begins a member prune operation, kicking every member that has been offline for the specified number of days. Requires KickMembers. |
| BulkDeleteMessages(ITextChannel, IEnumerable<DiscordMessage>, bool) | Deletes a group of messages all at once from a text channel. This is much faster than calling DeleteMessage for each message. Requires ManageMessages. |
| BulkDeleteMessages(ITextChannel, IEnumerable<Snowflake>, bool) | Deletes a group of messages all at once from a text channel. This is much faster than calling DeleteMessage for each message. Requires ManageMessages. |
| BulkDeleteMessages(Snowflake, IEnumerable<DiscordMessage>, bool) | Deletes a group of messages all at once from a text channel. This is much faster than calling DeleteMessage for each message. Requires ManageMessages. |
| BulkDeleteMessages(Snowflake, IEnumerable<Snowflake>, bool) | Deletes a group of messages all at once from a text channel. This is much faster than calling DeleteMessage for each message. Requires ManageMessages. |
| CreateChannelInvite(DiscordGuildChannel, TimeSpan?, int?, bool?, bool?) | Creates a new invite for the specified guild channel. Requires CreateInstantInvite. |
| CreateChannelInvite(Snowflake, TimeSpan?, int?, bool?, bool?) | Creates a new invite for the specified guild channel. Requires CreateInstantInvite. |
| CreateDM(DiscordUser) | Opens a DM channel with the specified user. |
| CreateDM(Snowflake) | Opens a DM channel with the specified user. |
| CreateGuild(CreateGuildOptions) | Creates a new guild. |
| CreateGuildBan(DiscordGuild, DiscordUser, int?) | Bans a user from the specified guild. Requires BanMembers. |
| CreateGuildBan(DiscordGuildMember, int?) | Bans a user from the specified guild. Requires BanMembers. |
| CreateGuildBan(Snowflake, Snowflake, int?) | Bans a user from the specified guild. Requires BanMembers. |
| CreateGuildChannel(DiscordGuild, CreateGuildChannelOptions) | Creates a new text channel, voice channel, or channel category for a guild. Requires ManageChannels. |
| CreateGuildChannel(Snowflake, CreateGuildChannelOptions) | Creates a new text channel, voice channel, or channel category for a guild. Requires ManageChannels. |
| CreateGuildEmoji(DiscordGuild, CreateGuildEmojiOptions) | Creates and returns a new guild emoji. Requires ManageEmojis. |
| CreateGuildEmoji(Snowflake, CreateGuildEmojiOptions) | Creates and returns a new guild emoji. Requires ManageEmojis. |
| CreateGuildIntegration(DiscordGuild, DiscordIntegration) | Attaches an integration from the current bot to the specified guild. Requires ManageGuild. |
| CreateGuildIntegration(Snowflake, Snowflake, string) | Attaches an integration from the current bot to the specified guild. Requires ManageGuild. |
| CreateGuildRole(DiscordGuild, CreateRoleOptions) | Creates a new role for a guild. |
| CreateGuildRole(Snowflake, CreateRoleOptions) | Creates a new role for a guild. |
| CreateMessage(ITextChannel, CreateMessageOptions) | Posts a message to a text channel. Note: Bot user accounts must connect to the Gateway at least once before being able to send messages. Requires SendMessages. Requires SendTtsMessages if TTS is enabled on the message. |
| CreateMessage(ITextChannel, string) | Posts a message to a text channel. Note: Bot user accounts must connect to the Gateway at least once before being able to send messages. Requires SendMessages. |
| CreateMessage(Snowflake, CreateMessageOptions) | Posts a message to a text channel. Note: Bot user accounts must connect to the Gateway at least once before being able to send messages. Requires SendMessages. Requires SendTtsMessages if TTS is enabled on the message. |
| CreateMessage(Snowflake, string) | Posts a message to a text channel. Note: Bot user accounts must connect to the Gateway at least once before being able to send messages. Requires SendMessages. |
| CreateReaction(DiscordMessage, DiscordReactionEmoji) | Adds a reaction to a message. Requires ReadMessageHistory. Requires AddReactions if nobody else has reacted to the message prior. |
| CreateReaction(Snowflake, Snowflake, DiscordReactionEmoji) | Adds a reaction to a message. Requires ReadMessageHistory. Requires AddReactions if nobody else has reacted to the message prior. |
| CreateWebhook(string, DiscordImageData, ITextChannel) | Creates a webhook. Requires ManageWebhooks. |
| CreateWebhook(string, DiscordImageData, Snowflake) | Creates a webhook. Requires ManageWebhooks. |
| DeleteAllReactions(DiscordMessage) | Deletes all reactions on a message. Requires ManageMessages. |
| DeleteAllReactions(Snowflake, Snowflake) | Deletes all reactions on a message. Requires ManageMessages. |
| DeleteChannel(DiscordChannel) | Deletes a guild channel, or closes a DM. Requires ManageChannels if deleting a guild channel. |
| DeleteChannel(Snowflake) | Deletes a guild channel, or closes a DM. Requires ManageChannels if deleting a guild channel. |
| DeleteChannel<T>(T) | Deletes a guild channel, or closes a DM. Requires ManageChannels if deleting a guild channel. |
| DeleteChannel<T>(Snowflake) | Deletes a guild channel, or closes a DM. Requires ManageChannels if deleting a guild channel. |
| DeleteChannelPermission(DiscordOverwrite) | Deletes a guild channel permission overwrite for a user or role. Requires ManageRoles. |
| DeleteChannelPermission(Snowflake, Snowflake) | Deletes a guild channel permission overwrite for a user or role. Requires ManageRoles. |
| DeleteGuild(DiscordGuild) | Deletes a guild permanently. Note: current bot must be the owner. |
| DeleteGuild(Snowflake) | Deletes a guild permanently. Note: current bot must be the owner. |
| DeleteGuildEmoji(DiscordGuild, DiscordEmoji) | Deletes a guild's emoji. Requires ManageEmojis. |
| DeleteGuildEmoji(Snowflake, Snowflake) | Deletes a guild's emoji. Requires ManageEmojis. |
| DeleteGuildIntegration(DiscordIntegration) | Deletes an attached integration from the specified channel. Requires ManageGuild. |
| DeleteGuildIntegration(Snowflake, Snowflake) | Deletes an attached integration from the specified channel. Requires ManageGuild. |
| DeleteGuildRole(DiscordRole) | Deletes a role from a guild. Requires ManageRoles. |
| DeleteGuildRole(Snowflake, Snowflake) | Deletes a role from a guild. Requires ManageRoles. |
| DeleteInvite(DiscordInvite) | Deletes an invite to a channel. Requires ManageChannels. |
| DeleteInvite(string) | Deletes an invite to a channel. Requires ManageChannels. |
| DeleteMessage(DiscordMessage) | Deletes a message from a text channel. Requires ManageMessages. |
| DeleteMessage(Snowflake, Snowflake) | Deletes a message from a text channel. Requires ManageMessages. |
| DeleteOwnReaction(DiscordMessage, DiscordReactionEmoji) | Deletes a reaction that the current bot has added to a message. |
| DeleteOwnReaction(Snowflake, Snowflake, DiscordReactionEmoji) | Deletes a reaction that the current bot has added to a message. |
| DeletePinnedChannelMessage(DiscordMessage) | Unpins a message from a text channel. Requires ManageMessages. |
| DeletePinnedChannelMessage(Snowflake, Snowflake) | Unpins a message from a text channel. Requires ManageMessages. |
| DeleteUserReaction(DiscordMessage, DiscordUser, DiscordReactionEmoji) | Deletes a reaction posted by any user. Requires ManageMessages. |
| DeleteUserReaction(Snowflake, Snowflake, Snowflake, DiscordReactionEmoji) | Deletes a reaction posted by any user. Requires ManageMessages. |
| DeleteWebhook(DiscordWebhook) | Deletes a webhook permanently. The current bot must be the owner. Requires ManageWebhooks. |
| DeleteWebhook(Snowflake) | Deletes a webhook permanently. The current bot must be the owner. Requires ManageWebhooks. |
| DeleteWebhookWithToken(DiscordWebhook, string) | Deletes a webhook permanently. |
| DeleteWebhookWithToken(Snowflake, string) | Deletes a webhook permanently. |
| Dispose() | |
| EditChannelPermissions(DiscordOverwrite, DiscordPermission, DiscordPermission, DiscordOverwriteType) | Edits a guild channel permission overwrite for a user or role. Requires ManageRoles. |
| EditChannelPermissions(Snowflake, Snowflake, DiscordPermission, DiscordPermission, DiscordOverwriteType) | Edits a guild channel permission overwrite for a user or role. Requires ManageRoles. |
| EditMessage(DiscordMessage, EditMessageOptions) | Edits an existing message in a text channel. |
| EditMessage(DiscordMessage, string) | Edits an existing message in a text channel. |
| EditMessage(Snowflake, Snowflake, EditMessageOptions) | Edits an existing message in a text channel. |
| EditMessage(Snowflake, Snowflake, string) | Edits an existing message in a text channel. |
| ExecuteWebhook(DiscordWebhook, string, ExecuteWebhookOptions, bool) | Executes a webhook. Note: Returns null unless |
| ExecuteWebhook(DiscordWebhook, string, ArraySegment<byte>, string, ExecuteWebhookOptions?, bool) | Executes a webhook with a file attachment. Note: Returns null unless |
| ExecuteWebhook(DiscordWebhook, string, Stream, string, ExecuteWebhookOptions?, bool) | Executes a webhook with a file attachment. Note: Returns null unless |
| ExecuteWebhook(Snowflake, string, ExecuteWebhookOptions, bool) | Executes a webhook. Note: Returns null unless |
| ExecuteWebhook(Snowflake, string, ArraySegment<byte>, string, ExecuteWebhookOptions?, bool) | Executes a webhook with a file attachment. Note: Returns null unless |
| ExecuteWebhook(Snowflake, string, Stream, string, ExecuteWebhookOptions?, bool) | Executes a webhook with a file attachment. Note: Returns null unless |
| GetBotRequiredShards() | Gets the minimum number of required shards for the current bot. |
| GetChannel(Snowflake) | Gets a DM or guild channel by ID. |
| GetChannel<T>(Snowflake) | Gets a DM or guild channel by ID. |
| GetChannelInvites(DiscordGuildChannel) | Gets a list of all invites for the specified guild channel. Requires ManageChannels. |
| GetChannelInvites(Snowflake) | Gets a list of all invites for the specified guild channel. Requires ManageChannels. |
| GetChannelMessage(ITextChannel, Snowflake) | Gets a single message by ID from a channel. Requires ReadMessageHistory. |
| GetChannelMessage(Snowflake, Snowflake) | Gets a single message by ID from a channel. Requires ReadMessageHistory. |
| GetChannelMessages(ITextChannel, Snowflake?, int?, MessageGetStrategy) | Gets messages from a text channel. Requires ReadMessages. |
| GetChannelMessages(Snowflake, Snowflake?, int?, MessageGetStrategy) | Gets messages from a text channel. Requires ReadMessages. |
| GetChannelWebhooks(ITextChannel) | Gets a list of webhooks active for the specified text channel. Requires ManageWebhooks. |
| GetChannelWebhooks(Snowflake) | Gets a list of webhooks active for the specified text channel. Requires ManageWebhooks. |
| GetCurrentUser() | Gets the user object of the current bot. |
| GetCurrentUserGuilds(int?, Snowflake?, GuildGetStrategy) | Gets a list of user guilds the current bot is in. |
| GetGuild(Snowflake) | Gets a guild by ID. |
| GetGuildBans(DiscordGuild) | Gets a list of all users that are banned from the specified guild. Requires BanMembers. |
| GetGuildBans(Snowflake) | Gets a list of all users that are banned from the specified guild. Requires BanMembers. |
| GetGuildChannels(DiscordGuild) | Gets a list of all channels in a guild. |
| GetGuildChannels(Snowflake) | Gets a list of all channels in a guild. |
| GetGuildEmoji(DiscordGuild, Snowflake) | Gets a guild's emoji. |
| GetGuildEmoji(Snowflake, Snowflake) | Gets a guild's emoji. |
| GetGuildIntegrations(DiscordGuild) | Gets a list of integrations for the specified guild. Requires ManageGuild. |
| GetGuildIntegrations(Snowflake) | Gets a list of integrations for the specified guild. Requires ManageGuild. |
| GetGuildInvites(DiscordGuild) | Gets a list of invites for the specified guild. Requires ManageGuild. |
| GetGuildInvites(Snowflake) | Gets a list of invites for the specified guild. Requires ManageGuild. |
| GetGuildMember(DiscordGuild, DiscordUser) | Gets a member in a guild by their user ID. |
| GetGuildMember(Snowflake, Snowflake) | Gets a member in a guild by their user ID. |
| GetGuildPruneCount(DiscordGuild, int?, IEnumerable<DiscordRole>?) | Returns the number of members that would be kicked from a guild prune operation. Requires KickMembers. |
| GetGuildPruneCount(Snowflake, int?, IEnumerable<Snowflake>?) | Returns the number of members that would be kicked from a guild prune operation. Requires KickMembers. |
| GetGuildRoles(DiscordGuild) | Gets a list of all roles in a guild. Requires ManageRoles. |
| GetGuildRoles(Snowflake) | Gets a list of all roles in a guild. Requires ManageRoles. |
| GetGuildVoiceRegions(DiscordGuild) | Gets a list of all voice regions available to the specified guild. |
| GetGuildVoiceRegions(Snowflake) | Gets a list of all voice regions available to the specified guild. |
| GetGuildWebhooks(DiscordGuild) | Gets a list of all webhooks in a guild. Requires ManageWebhooks. |
| GetGuildWebhooks(Snowflake) | Gets a list of all webhooks in a guild. Requires ManageWebhooks. |
| GetGuildWidget(DiscordGuild) | Returns the embed for the specified guild. Requires ManageGuild. |
| GetGuildWidget(Snowflake) | Returns the embed for the specified guild. Requires ManageGuild. |
| GetInvite(string, bool?) | Gets an invite by its code. |
| GetPinnedMessages(ITextChannel) | Gets a list of all pinned messages in a text channel. |
| GetPinnedMessages(Snowflake) | Gets a list of all pinned messages in a text channel. |
| GetReactions(DiscordMessage, DiscordReactionEmoji, Snowflake?, int?, ReactionGetStrategy) | Gets a paginated list of users who reacted to the specified message with the specified emoji. |
| GetReactions(Snowflake, Snowflake, DiscordReactionEmoji, Snowflake?, int?, ReactionGetStrategy) | Gets a paginated list of users who reacted to the specified message with the specified emoji. |
| GetUser(Snowflake) | Gets a user by their ID. |
| GetWebhook(Snowflake) | Gets a webhook via its ID. |
| GetWebhookWithToken(Snowflake, string) | Gets a webhook via its ID. This call does not require authentication and returns no user in the webhook object. |
| LeaveGuild(DiscordGuild) | Removes the current bot from the specified guild. |
| LeaveGuild(Snowflake) | Removes the current bot from the specified guild. |
| ListGuildEmojis(DiscordGuild) | Gets a list of all emojis in a guild. |
| ListGuildEmojis(Snowflake) | Gets a list of all emojis in a guild. |
| ListGuildMembers(DiscordGuild, int?, Snowflake?) | Gets a list of members in a guild. This method is paged, and cannot always return every member at once. |
| ListGuildMembers(Snowflake, int?, Snowflake?) | Gets a list of members in a guild. This method is paged, and cannot always return every member at once. |
| ListVoiceRegions() | Gets a list of available voice regions. |
| ModifyCategoryChannel(DiscordGuildCategoryChannel, GuildCategoryChannelOptions) | Updates the settings of a guild category channel. Requires ManageChannels. |
| ModifyCategoryChannel(Snowflake, GuildCategoryChannelOptions) | Updates the settings of a guild category channel. Requires ManageChannels. |
| ModifyCurrentUser(string?, DiscordImageData?) | Modifies the current bot's user object. Parameters left null will leave the properties unchanged. |
| ModifyCurrentUsersNickname(DiscordGuild, string?) | Modifies the current bot's nickname in the specified guild. Requires ChangeNickname. |
| ModifyCurrentUsersNickname(Snowflake, string?) | Modifies the current bot's nickname in the specified guild. Requires ChangeNickname. |
| ModifyGuild(DiscordGuild, ModifyGuildOptions) | Changes the settings of a guild. Requires ManageGuild. |
| ModifyGuild(Snowflake, ModifyGuildOptions) | Changes the settings of a guild. Requires ManageGuild. |
| ModifyGuildChannelPositions(DiscordGuild, IEnumerable<PositionOptions>) | Changes the positions of channels in the specified guild. The list of positions does not need to include every channel, it just needs the channels that are being moved. Requires ManageChannels. |
| ModifyGuildChannelPositions(Snowflake, IEnumerable<PositionOptions>) | Changes the positions of channels in the specified guild. The list of positions does not need to include every channel, it just needs the channels that are being moved. Requires ManageChannels. |
| ModifyGuildEmoji(DiscordGuild, DiscordEmoji, ModifyGuildEmojiOptions) | Updates an existing guild emoji. Requires ManageEmojis. |
| ModifyGuildEmoji(Snowflake, Snowflake, ModifyGuildEmojiOptions) | Updates an existing guild emoji. Requires ManageEmojis. |
| ModifyGuildIntegration(DiscordIntegration, ModifyIntegrationOptions) | Changes the attributes of a guild integration. Requires ManageGuild. |
| ModifyGuildIntegration(Snowflake, Snowflake, ModifyIntegrationOptions) | Changes the attributes of a guild integration. Requires ManageGuild. |
| ModifyGuildMember(DiscordGuildMember, ModifyGuildMemberOptions) | Modifies the attributes of a guild member. |
| ModifyGuildMember(Snowflake, Snowflake, ModifyGuildMemberOptions) | Modifies the attributes of a guild member. |
| ModifyGuildRole(DiscordRole, ModifyRoleOptions) | Modifies the settings of a guild role. Requires ManageRoles. |
| ModifyGuildRole(Snowflake, Snowflake, ModifyRoleOptions) | Modifies the settings of a guild role. Requires ManageRoles. |
| ModifyGuildRolePositions(DiscordGuild, IEnumerable<PositionOptions>) | Modifies the sorting positions of roles in a guild. Requires ManageRoles. |
| ModifyGuildRolePositions(Snowflake, IEnumerable<PositionOptions>) | Modifies the sorting positions of roles in a guild. Requires ManageRoles. |
| ModifyGuildWidget(DiscordGuild, ModifyGuildWidgetOptions) | Modifies the properties of the widget for the specified guild. Requires ManageGuild. |
| ModifyGuildWidget(Snowflake, ModifyGuildWidgetOptions) | Modifies the properties of the widget for the specified guild. Requires ManageGuild. |
| ModifyNewsChannel(DiscordGuildNewsChannel, GuildNewsChannelOptions) | Updates the settings of a guild news channel. Requires ManageChannels. |
| ModifyNewsChannel(Snowflake, GuildNewsChannelOptions) | Updates the settings of a guild news channel. Requires ManageChannels. |
| ModifyStoreChannel(DiscordGuildStoreChannel, GuildStoreChannelOptions) | Updates the settings of a guild store channel. Requires ManageChannels. |
| ModifyStoreChannel(Snowflake, GuildStoreChannelOptions) | Updates the settings of a guild store channel. Requires ManageChannels. |
| ModifyTextChannel(DiscordGuildTextChannel, GuildTextChannelOptions) | Updates the settings of a guild text channel. Requires ManageChannels. |
| ModifyTextChannel(Snowflake, GuildTextChannelOptions) | Updates the settings of a guild text channel. Requires ManageChannels. |
| ModifyVoiceChannel(DiscordGuildVoiceChannel, GuildVoiceChannelOptions) | Updates the settings of a guild voice channel. Requires ManageChannels. |
| ModifyVoiceChannel(Snowflake, GuildVoiceChannelOptions) | Updates the settings of a guild voice channel. Requires ManageChannels. |
| ModifyWebhook(DiscordWebhook, string?, DiscordImageData?, ITextChannel?) | Modifies an existing webhook. Requires ManageWebhooks. |
| ModifyWebhook(Snowflake, string?, DiscordImageData?, Snowflake?) | Modifies an existing webhook. Requires ManageWebhooks. |
| ModifyWebhookWithToken(DiscordWebhook, string, string?, DiscordImageData?) | Modifies an existing webhook. |
| ModifyWebhookWithToken(Snowflake, string, string?, DiscordImageData?) | Modifies an existing webhook. |
| RemoveGuildBan(DiscordGuild, DiscordUser) | Removes a user ban from the specified guild. Requires BanMembers. |
| RemoveGuildBan(Snowflake, Snowflake) | Removes a user ban from the specified guild. Requires BanMembers. |
| RemoveGuildMember(DiscordGuild, DiscordUser) | Removes a member from a guild. Requires KickMembers. |
| RemoveGuildMember(DiscordGuildMember) | Removes a member from a guild. Requires KickMembers. |
| RemoveGuildMember(Snowflake, Snowflake) | Removes a member from a guild. Requires KickMembers. |
| RemoveGuildMemberRole(DiscordGuildMember, DiscordRole) | Removes a role from a guild member. Requires ManageRoles. |
| RemoveGuildMemberRole(Snowflake, Snowflake, Snowflake) | Removes a role from a guild member. Requires ManageRoles. |
| SyncGuildIntegration(DiscordIntegration) | Synchronizes a guild integration. Requires ManageGuild. |
| SyncGuildIntegration(Snowflake, Snowflake) | Synchronizes a guild integration. Requires ManageGuild. |
| TriggerTypingIndicator(ITextChannel) | Causes the current bot to appear as typing in this channel. Note: it is recommended that bots do not generally use this route. This should only be used if the bot is responding to a command that is expected to take a few seconds or longer. |
| TriggerTypingIndicator(Snowflake) | Causes the current bot to appear as typing in this channel. Note: it is recommended that bots do not generally use this route. This should only be used if the bot is responding to a command that is expected to take a few seconds or longer. |