Show / Hide Table of Contents

    Class DiscordRestClient

    Inheritance
    Object
    BaseDiscordClient
    DiscordRestClient
    Inherited Members
    BaseDiscordClient.ApiClient
    BaseDiscordClient.Configuration
    BaseDiscordClient.Logger
    BaseDiscordClient.VersionString
    BaseDiscordClient.CurrentUser
    BaseDiscordClient.CurrentApplication
    BaseDiscordClient.UserCache
    BaseDiscordClient.VoiceRegions
    BaseDiscordClient.InternalVoiceRegions
    BaseDiscordClient.GetCurrentApplicationAsync()
    BaseDiscordClient.ListVoiceRegionsAsync()
    BaseDiscordClient.InitializeAsync()
    BaseDiscordClient.GetGatewayInfoAsync(String)
    Namespace: DSharpPlus
    Assembly: cs.temp.dll.dll
    Syntax
    public class DiscordRestClient : BaseDiscordClient

    Constructors

    DiscordRestClient(DiscordConfiguration)

    Declaration
    public DiscordRestClient(DiscordConfiguration config)
    Parameters
    Type Name Description
    DiscordConfiguration config

    Properties

    Guilds

    Gets the dictionary of guilds cached by this client.

    Declaration
    public override IReadOnlyDictionary<ulong, DiscordGuild> Guilds { get; }
    Property Value
    Type Description
    IReadOnlyDictionary<UInt64, DiscordGuild>
    Overrides
    BaseDiscordClient.Guilds

    Methods

    AddGuildMemberAsync(UInt64, UInt64, String, String, IEnumerable<DiscordRole>, Boolean, Boolean)

    Adds a member to a guild

    Declaration
    public Task<DiscordMember> AddGuildMemberAsync(ulong guild_id, ulong user_id, string access_token, string nick, IEnumerable<DiscordRole> roles, bool muted, bool deafened)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    String access_token

    Access token

    String nick

    User nickname

    IEnumerable<DiscordRole> roles

    User roles

    Boolean muted

    Whether this user should be muted on join

    Boolean deafened

    Whether this user should be deafened on join

    Returns
    Type Description
    Task<DiscordMember>

    AddGuildMemberRoleAsync(UInt64, UInt64, UInt64, String)

    Add role to guild member

    Declaration
    public Task AddGuildMemberRoleAsync(ulong guild_id, ulong user_id, ulong role_id, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    UInt64 role_id

    Role ID

    String reason

    Reason this role gets added

    Returns
    Type Description
    Task

    AddThreadMemberAsync(UInt64, UInt64)

    Adds a member to a thread.

    Declaration
    public Task AddThreadMemberAsync(ulong threadId, ulong userId)
    Parameters
    Type Name Description
    UInt64 threadId

    The ID of the thread.

    UInt64 userId

    The ID of the member.

    Returns
    Type Description
    Task

    BatchEditApplicationCommandPermissionsAsync(UInt64, IEnumerable<DiscordGuildApplicationCommandPermissions>)

    Batch edits permissions for a application command in a guild.

    Declaration
    public Task<IReadOnlyList<DiscordGuildApplicationCommandPermissions>> BatchEditApplicationCommandPermissionsAsync(ulong guildId, IEnumerable<DiscordGuildApplicationCommandPermissions> permissions)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild ID.

    IEnumerable<DiscordGuildApplicationCommandPermissions> permissions

    The list of permissions to use.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordGuildApplicationCommandPermissions>>

    A list of edited permissions.

    BeginGuildPruneAsync(UInt64, Int32, Boolean, IEnumerable<UInt64>, String)

    Begins a guild prune.

    Declaration
    public Task<int?> BeginGuildPruneAsync(ulong guild_id, int days, bool compute_prune_count, IEnumerable<ulong> include_roles, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Int32 days

    Days to prune for

    Boolean compute_prune_count

    Whether to return the prune count after this method completes. This is discouraged for larger guilds.

    IEnumerable<UInt64> include_roles

    The roles to be included in the prune.

    String reason

    Reason why this guild was pruned

    Returns
    Type Description
    Task<Nullable<Int32>>

    BulkOverwriteGlobalApplicationCommandsAsync(IEnumerable<DiscordApplicationCommand>)

    Overwrites the existing global application commands. New commands are automatically created and missing commands are automatically deleted.

    Declaration
    public Task<IReadOnlyList<DiscordApplicationCommand>> BulkOverwriteGlobalApplicationCommandsAsync(IEnumerable<DiscordApplicationCommand> commands)
    Parameters
    Type Name Description
    IEnumerable<DiscordApplicationCommand> commands

    The list of commands to overwrite with.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordApplicationCommand>>

    The list of global commands.

    BulkOverwriteGuildApplicationCommandsAsync(UInt64, IEnumerable<DiscordApplicationCommand>)

    Overwrites the existing application commands in a guild. New commands are automatically created and missing commands are automatically deleted.

    Declaration
    public Task<IReadOnlyList<DiscordApplicationCommand>> BulkOverwriteGuildApplicationCommandsAsync(ulong guildId, IEnumerable<DiscordApplicationCommand> commands)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    IEnumerable<DiscordApplicationCommand> commands

    The list of commands to overwrite with.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordApplicationCommand>>

    The list of guild commands.

    CreateChannelInviteAsync(UInt64, Int32, Int32, Boolean, Boolean, String, Nullable<InviteTargetType>, Nullable<UInt64>, Nullable<UInt64>)

    Creates a channel invite

    Declaration
    public Task<DiscordInvite> CreateChannelInviteAsync(ulong channel_id, int max_age, int max_uses, bool temporary, bool unique, string reason, InviteTargetType? targetType = null, ulong? targetUserId = null, ulong? targetApplicationId = null)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Int32 max_age

    For how long the invite should exist

    Int32 max_uses

    How often the invite may be used

    Boolean temporary

    Whether this invite should be temporary

    Boolean unique

    Whether this invite should be unique (false might return an existing invite)

    String reason

    Why you made an invite

    Nullable<InviteTargetType> targetType

    The target type of the invite, for stream and embedded application invites.

    Nullable<UInt64> targetUserId

    The ID of the target user.

    Nullable<UInt64> targetApplicationId

    The ID of the target application.

    Returns
    Type Description
    Task<DiscordInvite>

    CreateDmAsync(UInt64)

    Creates a DM

    Declaration
    public Task<DiscordDmChannel> CreateDmAsync(ulong recipient_id)
    Parameters
    Type Name Description
    UInt64 recipient_id

    Recipient user ID

    Returns
    Type Description
    Task<DiscordDmChannel>

    CreateEmojiAsync(UInt64, String, Stream, IEnumerable<UInt64>, String)

    Creates an emoji in a guild.

    Declaration
    public Task<DiscordGuildEmoji> CreateEmojiAsync(ulong guildId, string name, Stream image, IEnumerable<ulong> roles = null, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    String name

    Name of the emoji.

    Stream image

    Image to use as the emoji.

    IEnumerable<UInt64> roles

    Roles for which the emoji will be available.

    String reason

    Reason for audit logs.

    Returns
    Type Description
    Task<DiscordGuildEmoji>

    CreateFollowupMessageAsync(String, DiscordFollowupMessageBuilder)

    Creates a follow up message to an interaction.

    Declaration
    public async Task<DiscordMessage> CreateFollowupMessageAsync(string interactionToken, DiscordFollowupMessageBuilder builder)
    Parameters
    Type Name Description
    String interactionToken

    The token of the interaction.

    DiscordFollowupMessageBuilder builder

    The webhook builder.

    Returns
    Type Description
    Task<DiscordMessage>

    The created.

    CreateGlobalApplicationCommandAsync(DiscordApplicationCommand)

    Creates or overwrites a global application command.

    Declaration
    public Task<DiscordApplicationCommand> CreateGlobalApplicationCommandAsync(DiscordApplicationCommand command)
    Parameters
    Type Name Description
    DiscordApplicationCommand command

    The command to create.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The created command.

    CreateGroupDmAsync(IEnumerable<String>, IDictionary<UInt64, String>)

    Creates a group DM

    Declaration
    public Task<DiscordDmChannel> CreateGroupDmAsync(IEnumerable<string> access_tokens, IDictionary<ulong, string> nicks)
    Parameters
    Type Name Description
    IEnumerable<String> access_tokens

    Access tokens

    IDictionary<UInt64, String> nicks

    Nicknames per user

    Returns
    Type Description
    Task<DiscordDmChannel>

    CreateGroupDmWithCurrentUserAsync(IEnumerable<String>, IDictionary<UInt64, String>)

    Creates a group DM with current user

    Declaration
    public Task<DiscordDmChannel> CreateGroupDmWithCurrentUserAsync(IEnumerable<string> access_tokens, IDictionary<ulong, string> nicks)
    Parameters
    Type Name Description
    IEnumerable<String> access_tokens

    Access tokens

    IDictionary<UInt64, String> nicks

    Nicknames

    Returns
    Type Description
    Task<DiscordDmChannel>

    CreateGuildApplicationCommandAsync(UInt64, DiscordApplicationCommand)

    Creates or overwrites a guild application command.

    Declaration
    public Task<DiscordApplicationCommand> CreateGuildApplicationCommandAsync(ulong guildId, DiscordApplicationCommand command)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild to create the application command in.

    DiscordApplicationCommand command

    The command to create.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The created command.

    CreateGuildAsync(String, String, String, Nullable<VerificationLevel>, Nullable<DefaultMessageNotifications>, Nullable<SystemChannelFlags>)

    Creates a new guild

    Declaration
    public Task<DiscordGuild> CreateGuildAsync(string name, string region_id, string iconb64, VerificationLevel? verification_level, DefaultMessageNotifications? default_message_notifications, SystemChannelFlags? system_channel_flags)
    Parameters
    Type Name Description
    String name

    New guild's name

    String region_id

    New guild's region ID

    String iconb64

    New guild's icon (base64)

    Nullable<VerificationLevel> verification_level

    New guild's verification level

    Nullable<DefaultMessageNotifications> default_message_notifications

    New guild's default message notification level

    Nullable<SystemChannelFlags> system_channel_flags

    New guild's system channel flags

    Returns
    Type Description
    Task<DiscordGuild>

    CreateGuildBanAsync(UInt64, UInt64, Int32, String)

    Creates guild ban

    Declaration
    public Task CreateGuildBanAsync(ulong guild_id, ulong user_id, int delete_message_days, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    Int32 delete_message_days

    Days to delete messages

    String reason

    Reason why this member was banned

    Returns
    Type Description
    Task

    CreateGuildChannelAsync(UInt64, String, ChannelType, Nullable<UInt64>, Optional<String>, Nullable<Int32>, Nullable<Int32>, IEnumerable<DiscordOverwriteBuilder>, Nullable<Boolean>, Optional<Nullable<Int32>>, Nullable<VideoQualityMode>, Nullable<Int32>, String)

    Creates a guild channel

    Declaration
    public Task<DiscordChannel> CreateGuildChannelAsync(ulong id, string name, ChannelType type, ulong? parent, Optional<string> topic, int? bitrate, int? userLimit, IEnumerable<DiscordOverwriteBuilder> overwrites, bool? nsfw, Optional<int?> perUserRateLimit, VideoQualityMode? qualityMode, int? position, string reason)
    Parameters
    Type Name Description
    UInt64 id

    Channel ID

    String name

    Channel name

    ChannelType type

    Channel type

    Nullable<UInt64> parent

    Channel parent ID

    Optional<String> topic

    Channel topic

    Nullable<Int32> bitrate

    Voice channel bitrate

    Nullable<Int32> userLimit

    Voice channel user limit

    IEnumerable<DiscordOverwriteBuilder> overwrites

    Channel overwrites

    Nullable<Boolean> nsfw

    Whether this channel should be marked as NSFW

    Optional<Nullable<Int32>> perUserRateLimit

    Slow mode timeout for users.

    Nullable<VideoQualityMode> qualityMode

    Voice channel video quality mode.

    Nullable<Int32> position

    Sorting position of the channel.

    String reason

    Reason this channel was created

    Returns
    Type Description
    Task<DiscordChannel>

    CreateGuildFromTemplateAsync(String, String, String)

    Creates a guild from a template. This requires the bot to be in less than 10 guilds total.

    Declaration
    public Task<DiscordGuild> CreateGuildFromTemplateAsync(string code, string name, string icon)
    Parameters
    Type Name Description
    String code

    The template code.

    String name

    Name of the guild.

    String icon

    Stream containing the icon for the guild.

    Returns
    Type Description
    Task<DiscordGuild>

    The created guild.

    CreateGuildIntegrationAsync(UInt64, String, UInt64)

    Creates guild integration

    Declaration
    public Task<DiscordIntegration> CreateGuildIntegrationAsync(ulong guild_id, string type, ulong id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String type

    Integration type

    UInt64 id

    Integration id

    Returns
    Type Description
    Task<DiscordIntegration>

    CreateGuildRoleAsync(UInt64, String, Nullable<Permissions>, Nullable<Int32>, Nullable<Boolean>, Nullable<Boolean>, String, Stream, DiscordEmoji)

    Creates a new role

    Declaration
    public Task<DiscordRole> CreateGuildRoleAsync(ulong guild_id, string name, Permissions? permissions, int? color, bool? hoist, bool? mentionable, string reason, Stream icon = null, DiscordEmoji emoji = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String name

    Role name

    Nullable<Permissions> permissions

    Role permissions

    Nullable<Int32> color

    Role color

    Nullable<Boolean> hoist

    Whether this role should be hoisted

    Nullable<Boolean> mentionable

    Whether this role should be mentionable

    String reason

    Reason why this role was created

    Stream icon

    The icon to add to this role

    DiscordEmoji emoji

    The emoji to add to this role. Must be unicode.

    Returns
    Type Description
    Task<DiscordRole>

    CreateGuildStickerAsync(UInt64, String, String, String, Stream, StickerFormat, String)

    Creates a sticker in a guild.

    Declaration
    public Task<DiscordMessageSticker> CreateGuildStickerAsync(ulong guildId, string name, string description, string tags, Stream imageContents, StickerFormat format, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    String name

    The name of the sticker.

    String description

    The description of the sticker.

    String tags

    The tags of the sticker.

    Stream imageContents

    The image content of the sticker.

    StickerFormat format

    The image format of the sticker.

    String reason

    The reason this sticker is being created.

    Returns
    Type Description
    Task<DiscordMessageSticker>

    CreateGuildTemplateAsync(UInt64, String, String)

    Creates a guild template.

    Declaration
    public Task<DiscordGuildTemplate> CreateGuildTemplateAsync(ulong guild_id, string name, string description = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String name

    Name of the template.

    String description

    Description of the template.

    Returns
    Type Description
    Task<DiscordGuildTemplate>

    The template created.

    CreateInteractionResponseAsync(UInt64, String, InteractionResponseType, DiscordInteractionResponseBuilder)

    Creates a response to an interaction.

    Declaration
    public Task CreateInteractionResponseAsync(ulong interactionId, string interactionToken, InteractionResponseType type, DiscordInteractionResponseBuilder builder = null)
    Parameters
    Type Name Description
    UInt64 interactionId

    The ID of the interaction.

    String interactionToken

    The token of the interaction

    InteractionResponseType type

    The type of the response.

    DiscordInteractionResponseBuilder builder

    The data, if any, to send.

    Returns
    Type Description
    Task

    CreateMessageAsync(UInt64, Action<DiscordMessageBuilder>)

    Sends a message

    Declaration
    public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, Action<DiscordMessageBuilder> action)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Action<DiscordMessageBuilder> action

    The Discord Message builder.

    Returns
    Type Description
    Task<DiscordMessage>

    CreateMessageAsync(UInt64, DiscordEmbed)

    Sends a message

    Declaration
    public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, DiscordEmbed embed)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    DiscordEmbed embed

    Embed to attach

    Returns
    Type Description
    Task<DiscordMessage>

    CreateMessageAsync(UInt64, DiscordMessageBuilder)

    Sends a message

    Declaration
    public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, DiscordMessageBuilder builder)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    DiscordMessageBuilder builder

    The Discord Message builder.

    Returns
    Type Description
    Task<DiscordMessage>

    CreateMessageAsync(UInt64, String)

    Sends a message

    Declaration
    public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, string content)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    String content

    Message (text) content

    Returns
    Type Description
    Task<DiscordMessage>

    CreateMessageAsync(UInt64, String, DiscordEmbed)

    Sends a message

    Declaration
    public Task<DiscordMessage> CreateMessageAsync(ulong channel_id, string content, DiscordEmbed embed)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    String content

    Message (text) content

    DiscordEmbed embed

    Embed to attach

    Returns
    Type Description
    Task<DiscordMessage>

    CreateReactionAsync(UInt64, UInt64, String)

    Creates a new reaction

    Declaration
    public Task CreateReactionAsync(ulong channel_id, ulong message_id, string emoji)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    String emoji

    Emoji to react

    Returns
    Type Description
    Task

    CreateScheduledGuildEventAsync(UInt64, String, String, Nullable<UInt64>, ScheduledGuildEventType, ScheduledGuildEventPrivacyLevel, DateTimeOffset, Nullable<DateTimeOffset>, String)

    Creates a new scheduled guild event.

    Declaration
    public Task<DiscordScheduledGuildEvent> CreateScheduledGuildEventAsync(ulong guildId, string name, string description, ulong? channelId, ScheduledGuildEventType type, ScheduledGuildEventPrivacyLevel privacyLevel, DateTimeOffset start, DateTimeOffset? end, string location = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild to create an event on.

    String name

    The name of the event, up to 100 characters.

    String description

    The description of the event, up to 1000 characters.

    Nullable<UInt64> channelId

    The channel the event will take place in, if applicable.

    ScheduledGuildEventType type

    The type of event. If , a end time must be specified.

    ScheduledGuildEventPrivacyLevel privacyLevel

    The privacy level of the event.

    DateTimeOffset start

    When the event starts. Must be in the future and before the end date, if specified.

    Nullable<DateTimeOffset> end

    When the event ends. Required for

    String location

    Where this location takes place.

    Returns
    Type Description
    Task<DiscordScheduledGuildEvent>

    The created event.

    CreateStageInstanceAsync(UInt64, String, Nullable<PrivacyLevel>, String)

    Creates a stage instance in a stage channel.

    Declaration
    public Task<DiscordStageInstance> CreateStageInstanceAsync(ulong channelId, string topic, PrivacyLevel? privacyLevel = null, string reason = null)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the stage channel to create it in.

    String topic

    The topic of the stage instance.

    Nullable<PrivacyLevel> privacyLevel

    The privacy level of the stage instance.

    String reason

    The reason the stage instance was created.

    Returns
    Type Description
    Task<DiscordStageInstance>

    The created stage instance.

    CreateThreadAsync(UInt64, String, AutoArchiveDuration, ChannelType, String)

    Creates a thread.

    Declaration
    public Task<DiscordThreadChannel> CreateThreadAsync(ulong channelId, string name, AutoArchiveDuration archiveAfter, ChannelType threadType, string reason = null)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel.

    String name

    The name of the thread.

    AutoArchiveDuration archiveAfter

    The auto archive duration.

    ChannelType threadType

    The type of the thread.

    String reason

    Reason for audit logs.

    Returns
    Type Description
    Task<DiscordThreadChannel>

    CreateThreadFromMessageAsync(UInt64, UInt64, String, AutoArchiveDuration, String)

    Creates a thread from a message.

    Declaration
    public Task<DiscordThreadChannel> CreateThreadFromMessageAsync(ulong channelId, ulong messageId, string name, AutoArchiveDuration archiveAfter, string reason = null)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel.

    UInt64 messageId

    The ID of the message

    String name

    The name of the thread.

    AutoArchiveDuration archiveAfter

    The auto archive duration.

    String reason

    Reason for audit logs.

    Returns
    Type Description
    Task<DiscordThreadChannel>

    CreateWebhookAsync(UInt64, String, Stream, String)

    Creates a new webhook

    Declaration
    public Task<DiscordWebhook> CreateWebhookAsync(ulong channel_id, string name, Stream avatar = null, string reason = null)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    String name

    Webhook name

    Stream avatar

    Webhook avatar

    String reason

    Reason why this webhook was created

    Returns
    Type Description
    Task<DiscordWebhook>

    CreateWebhookAsync(UInt64, String, String, String)

    Creates a new webhook

    Declaration
    public Task<DiscordWebhook> CreateWebhookAsync(ulong channel_id, string name, string base64_avatar, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    String name

    Webhook name

    String base64_avatar

    Webhook avatar (base64)

    String reason

    Reason why this webhook was created

    Returns
    Type Description
    Task<DiscordWebhook>

    CrosspostMessageAsync(UInt64, UInt64)

    Publishes a message in a news channel to following channels

    Declaration
    public Task<DiscordMessage> CrosspostMessageAsync(ulong channel_id, ulong message_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    ID of the news channel the message to crosspost belongs to

    UInt64 message_id

    ID of the message to crosspost

    Returns
    Type Description
    Task<DiscordMessage>

    DeleteAllReactionsAsync(UInt64, UInt64, String)

    Deletes all reactions from a message

    Declaration
    public Task DeleteAllReactionsAsync(ulong channel_id, ulong message_id, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    String reason

    Reason why all reactions were removed

    Returns
    Type Description
    Task

    DeleteChannelAsync(UInt64, String)

    Deletes a channel

    Declaration
    public Task DeleteChannelAsync(ulong id, string reason)
    Parameters
    Type Name Description
    UInt64 id

    Channel ID

    String reason

    Reason why this channel was deleted

    Returns
    Type Description
    Task

    DeleteChannelPermissionAsync(UInt64, UInt64, String)

    Deletes channel overwrite

    Declaration
    public Task DeleteChannelPermissionAsync(ulong channel_id, ulong overwrite_id, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 overwrite_id

    Overwrite ID

    String reason

    Reason it was deleted

    Returns
    Type Description
    Task

    DeleteFollowupMessageAsync(String, UInt64)

    Deletes a follow up message.

    Declaration
    public Task DeleteFollowupMessageAsync(string interactionToken, ulong messageId)
    Parameters
    Type Name Description
    String interactionToken

    The token of the interaction.

    UInt64 messageId

    The ID of the follow up message.

    Returns
    Type Description
    Task

    DeleteGlobalApplicationCommandAsync(UInt64)

    Deletes a global application command.

    Declaration
    public Task DeleteGlobalApplicationCommandAsync(ulong commandId)
    Parameters
    Type Name Description
    UInt64 commandId

    The ID of the command to delete.

    Returns
    Type Description
    Task

    DeleteGuildApplicationCommandAsync(UInt64, UInt64)

    Deletes a application command in a guild.

    Declaration
    public Task DeleteGuildApplicationCommandAsync(ulong guildId, ulong commandId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild to delete the application command in.

    UInt64 commandId

    The ID of the command.

    Returns
    Type Description
    Task

    DeleteGuildAsync(UInt64)

    Deletes a guild

    Declaration
    public Task DeleteGuildAsync(ulong id)
    Parameters
    Type Name Description
    UInt64 id

    Guild ID

    Returns
    Type Description
    Task

    DeleteGuildEmojiAsync(UInt64, UInt64, String)

    Deletes a guild's emoji.

    Declaration
    public Task DeleteGuildEmojiAsync(ulong guildId, ulong emojiId, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 emojiId

    The ID of the emoji.

    String reason

    Reason for audit logs.

    Returns
    Type Description
    Task

    DeleteGuildIntegrationAsync(UInt64, DiscordIntegration, String)

    Removes a guild integration

    Declaration
    public Task DeleteGuildIntegrationAsync(ulong guild_id, DiscordIntegration integration, string reason = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    DiscordIntegration integration

    Integration to remove

    String reason

    Reason why this integration was removed

    Returns
    Type Description
    Task

    DeleteGuildRoleAsync(UInt64, UInt64, String)

    Deletes a role

    Declaration
    public Task DeleteGuildRoleAsync(ulong guild_id, ulong role_id, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 role_id

    Role ID

    String reason

    Reason why this role was deleted

    Returns
    Type Description
    Task

    DeleteGuildStickerAsync(UInt64, UInt64, String)

    Deletes a sticker in a guild.

    Declaration
    public Task DeleteGuildStickerAsync(ulong guildId, ulong stickerId, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 stickerId

    The ID of the sticker.

    String reason

    Reason for audit log.

    Returns
    Type Description
    Task

    DeleteGuildTemplateAsync(UInt64, String)

    Deletes the template.

    Declaration
    public Task<DiscordGuildTemplate> DeleteGuildTemplateAsync(ulong guild_id, string code)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String code

    The code of the template to delete.

    Returns
    Type Description
    Task<DiscordGuildTemplate>

    The deleted template.

    DeleteInvite(String, String)

    Removes an invite

    Declaration
    public Task<DiscordInvite> DeleteInvite(string invite_code, string reason)
    Parameters
    Type Name Description
    String invite_code

    Invite code

    String reason

    Reason why this invite was removed

    Returns
    Type Description
    Task<DiscordInvite>

    DeleteMessageAsync(UInt64, UInt64, String)

    Deletes a message

    Declaration
    public Task DeleteMessageAsync(ulong channel_id, ulong message_id, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    String reason

    Why this message was deleted

    Returns
    Type Description
    Task

    DeleteMessagesAsync(UInt64, IEnumerable<UInt64>, String)

    Deletes multiple messages

    Declaration
    public Task DeleteMessagesAsync(ulong channel_id, IEnumerable<ulong> message_ids, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    IEnumerable<UInt64> message_ids

    Message IDs

    String reason

    Reason these messages were deleted

    Returns
    Type Description
    Task

    DeleteOriginalInteractionResponseAsync(String)

    Deletes the original interaction response. The token of the interaction.

    Declaration
    public Task DeleteOriginalInteractionResponseAsync(string interactionToken)
    Parameters
    Type Name Description
    String interactionToken
    Returns
    Type Description
    Task

    DeleteOwnReactionAsync(UInt64, UInt64, String)

    Deletes own reaction

    Declaration
    public Task DeleteOwnReactionAsync(ulong channel_id, ulong message_id, string emoji)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    String emoji

    Emoji to remove from reaction

    Returns
    Type Description
    Task

    DeleteReactionsEmojiAsync(UInt64, UInt64, String)

    Deletes all reactions of a specific reaction for a message.

    Declaration
    public Task DeleteReactionsEmojiAsync(ulong channelid, ulong messageId, string emoji)
    Parameters
    Type Name Description
    UInt64 channelid

    The ID of the channel.

    UInt64 messageId

    The ID of the message.

    String emoji

    The emoji to clear.

    Returns
    Type Description
    Task

    DeleteScheduledGuildEventAsync(UInt64, UInt64)

    Delete a scheduled guild event.

    Declaration
    public Task DeleteScheduledGuildEventAsync(ulong guildId, ulong eventId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID the guild the event resides on.

    UInt64 eventId

    The ID of the event to delete.

    Returns
    Type Description
    Task

    DeleteStageInstanceAsync(UInt64, String)

    Deletes a stage instance in a stage channel.

    Declaration
    public Task DeleteStageInstanceAsync(ulong channelId, string reason = null)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel to delete the stage instance of.

    String reason

    The reason the stage instance was deleted.

    Returns
    Type Description
    Task

    DeleteUserReactionAsync(UInt64, UInt64, UInt64, String, String)

    Deletes someone elses reaction

    Declaration
    public Task DeleteUserReactionAsync(ulong channel_id, ulong message_id, ulong user_id, string emoji, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    UInt64 user_id

    User ID

    String emoji

    Emoji to remove

    String reason

    Reason why this reaction was removed

    Returns
    Type Description
    Task

    DeleteWebhookAsync(UInt64, String)

    Deletes a webhook

    Declaration
    public Task DeleteWebhookAsync(ulong webhook_id, string reason)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String reason

    Reason this webhook was deleted

    Returns
    Type Description
    Task

    DeleteWebhookAsync(UInt64, String, String)

    Deletes a webhook (when user is not in said guild)

    Declaration
    public Task DeleteWebhookAsync(ulong webhook_id, string reason, string webhook_token)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String reason

    Reason this webhook was removed

    String webhook_token

    Webhook token

    Returns
    Type Description
    Task

    DeleteWebhookMessageAsync(UInt64, String, UInt64)

    Deletes a message that was created by a webhook.

    Declaration
    public Task DeleteWebhookMessageAsync(ulong webhook_id, string webhook_token, ulong messageId)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String webhook_token

    Webhook token

    UInt64 messageId

    The ID of the message to delete

    Returns
    Type Description
    Task

    Dispose()

    Disposes of this DiscordRestClient

    Declaration
    public override void Dispose()
    Overrides
    BaseDiscordClient.Dispose()

    EditApplicationCommandPermissionsAsync(UInt64, UInt64, IEnumerable<DiscordApplicationCommandPermission>)

    Edits permissions for a application command in a guild.

    Declaration
    public Task<DiscordGuildApplicationCommandPermissions> EditApplicationCommandPermissionsAsync(ulong guildId, ulong commandId, IEnumerable<DiscordApplicationCommandPermission> permissions)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild ID.

    UInt64 commandId

    The ID of the command to edit permissions for.

    IEnumerable<DiscordApplicationCommandPermission> permissions

    The list of permissions to use.

    Returns
    Type Description
    Task<DiscordGuildApplicationCommandPermissions>

    The edited permissions.

    EditChannelPermissionsAsync(UInt64, UInt64, Permissions, Permissions, String, String)

    Edits channel overwrite

    Declaration
    public Task EditChannelPermissionsAsync(ulong channel_id, ulong overwrite_id, Permissions allow, Permissions deny, string type, string reason)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 overwrite_id

    Overwrite ID

    Permissions allow

    Permissions to allow

    Permissions deny

    Permissions to deny

    String type

    Overwrite type

    String reason

    Reason this overwrite was created

    Returns
    Type Description
    Task

    EditFollowupMessageAsync(String, UInt64, DiscordWebhookBuilder, IEnumerable<DiscordAttachment>)

    Edits a follow up message.

    Declaration
    public async Task<DiscordMessage> EditFollowupMessageAsync(string interactionToken, ulong messageId, DiscordWebhookBuilder builder, IEnumerable<DiscordAttachment> attachments = null)
    Parameters
    Type Name Description
    String interactionToken

    The token of the interaction.

    UInt64 messageId

    The ID of the follow up message.

    DiscordWebhookBuilder builder

    The webhook builder.

    IEnumerable<DiscordAttachment> attachments

    Attached files to keep.

    Returns
    Type Description
    Task<DiscordMessage>

    The edited.

    EditGlobalApplicationCommandAsync(UInt64, Action<ApplicationCommandEditModel>)

    Edits a global application command.

    Declaration
    public async Task<DiscordApplicationCommand> EditGlobalApplicationCommandAsync(ulong commandId, Action<ApplicationCommandEditModel> action)
    Parameters
    Type Name Description
    UInt64 commandId

    The ID of the command to edit.

    Action<ApplicationCommandEditModel> action

    Action to perform.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The edited command.

    EditGuildApplicationCommandAsync(UInt64, UInt64, Action<ApplicationCommandEditModel>)

    Edits a application command in a guild.

    Declaration
    public async Task<DiscordApplicationCommand> EditGuildApplicationCommandAsync(ulong guildId, ulong commandId, Action<ApplicationCommandEditModel> action)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild the application command is in.

    UInt64 commandId

    The ID of the command to edit.

    Action<ApplicationCommandEditModel> action

    Action to perform.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The edited command.

    EditMessageAsync(UInt64, UInt64, DiscordMessageBuilder, Boolean, IEnumerable<DiscordAttachment>)

    Edits a message

    Declaration
    public async Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, DiscordMessageBuilder builder, bool suppressEmbeds = false, IEnumerable<DiscordAttachment> attachments = null)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    DiscordMessageBuilder builder

    The builder of the message to edit.

    Boolean suppressEmbeds

    Whether to suppress embeds on the message.

    IEnumerable<DiscordAttachment> attachments

    Attached files to keep.

    Returns
    Type Description
    Task<DiscordMessage>

    EditMessageAsync(UInt64, UInt64, Optional<DiscordEmbed>)

    Edits a message

    Declaration
    public Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, Optional<DiscordEmbed> embed)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Optional<DiscordEmbed> embed

    New message embed

    Returns
    Type Description
    Task<DiscordMessage>

    EditMessageAsync(UInt64, UInt64, Optional<String>)

    Edits a message

    Declaration
    public Task<DiscordMessage> EditMessageAsync(ulong channel_id, ulong message_id, Optional<string> content)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Optional<String> content

    New message content

    Returns
    Type Description
    Task<DiscordMessage>

    EditOriginalInteractionResponseAsync(String, DiscordWebhookBuilder, IEnumerable<DiscordAttachment>)

    Edits the original interaction response.

    Declaration
    public async Task<DiscordMessage> EditOriginalInteractionResponseAsync(string interactionToken, DiscordWebhookBuilder builder, IEnumerable<DiscordAttachment> attachments = null)
    Parameters
    Type Name Description
    String interactionToken

    The token of the interaction.

    DiscordWebhookBuilder builder

    The webhook builder.

    IEnumerable<DiscordAttachment> attachments

    Attached files to keep.

    Returns
    Type Description
    Task<DiscordMessage>

    The edited.

    EditWebhookMessageAsync(UInt64, String, UInt64, DiscordWebhookBuilder, IEnumerable<DiscordAttachment>)

    Edits a previously-sent webhook message.

    Declaration
    public async Task<DiscordMessage> EditWebhookMessageAsync(ulong webhook_id, string webhook_token, ulong messageId, DiscordWebhookBuilder builder, IEnumerable<DiscordAttachment> attachments = null)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String webhook_token

    Webhook token

    UInt64 messageId

    The ID of the message to edit.

    DiscordWebhookBuilder builder

    The builder of the message to edit.

    IEnumerable<DiscordAttachment> attachments

    Attached files to keep.

    Returns
    Type Description
    Task<DiscordMessage>

    The modified

    ExecuteWebhookAsync(UInt64, String, DiscordWebhookBuilder)

    Sends a message to a webhook

    Declaration
    public Task<DiscordMessage> ExecuteWebhookAsync(ulong webhook_id, string webhook_token, DiscordWebhookBuilder builder)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String webhook_token

    Webhook token

    DiscordWebhookBuilder builder

    Webhook builder filled with data to send.

    Returns
    Type Description
    Task<DiscordMessage>

    FollowChannelAsync(UInt64, UInt64)

    Follows a news channel

    Declaration
    public Task<DiscordFollowedChannel> FollowChannelAsync(ulong channel_id, ulong webhook_channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    ID of the channel to follow

    UInt64 webhook_channel_id

    ID of the channel to crosspost messages to

    Returns
    Type Description
    Task<DiscordFollowedChannel>

    GetApplicationAssetsAsync(DiscordApplication)

    Gets assets from an application

    Declaration
    public Task<IReadOnlyList<DiscordApplicationAsset>> GetApplicationAssetsAsync(DiscordApplication application)
    Parameters
    Type Name Description
    DiscordApplication application

    Application to get assets from

    Returns
    Type Description
    Task<IReadOnlyList<DiscordApplicationAsset>>

    GetChannelAsync(UInt64)

    Gets a channel object

    Declaration
    public Task<DiscordChannel> GetChannelAsync(ulong id)
    Parameters
    Type Name Description
    UInt64 id

    Channel ID

    Returns
    Type Description
    Task<DiscordChannel>

    GetChannelInvitesAsync(UInt64)

    Gets a channel's invites

    Declaration
    public Task<IReadOnlyList<DiscordInvite>> GetChannelInvitesAsync(ulong channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordInvite>>

    GetChannelMessageAsync(UInt64, UInt64)

    Gets a message from a channel

    Declaration
    public Task<DiscordMessage> GetChannelMessageAsync(ulong channel_id, ulong message_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Returns
    Type Description
    Task<DiscordMessage>

    GetChannelMessagesAsync(UInt64, Int32, Nullable<UInt64>, Nullable<UInt64>, Nullable<UInt64>)

    Gets messages from a channel

    Declaration
    public Task<IReadOnlyList<DiscordMessage>> GetChannelMessagesAsync(ulong channel_id, int limit, ulong? before, ulong? after, ulong? around)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Int32 limit

    Limit of messages to get

    Nullable<UInt64> before

    Gets messages before this ID

    Nullable<UInt64> after

    Gets messages after this ID

    Nullable<UInt64> around

    Gets messages around this ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordMessage>>

    GetChannelWebhooksAsync(UInt64)

    Gets all webhooks from a channel

    Declaration
    public Task<IReadOnlyList<DiscordWebhook>> GetChannelWebhooksAsync(ulong channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordWebhook>>

    GetCurrentUserAsync()

    Gets current user object

    Declaration
    public Task<DiscordUser> GetCurrentUserAsync()
    Returns
    Type Description
    Task<DiscordUser>

    GetCurrentUserGuildsAsync(Int32, Nullable<UInt64>, Nullable<UInt64>)

    Gets current user's guilds

    Declaration
    public Task<IReadOnlyList<DiscordGuild>> GetCurrentUserGuildsAsync(int limit = 100, ulong? before = null, ulong? after = null)
    Parameters
    Type Name Description
    Int32 limit

    Limit of guilds to get

    Nullable<UInt64> before

    Gets guild before ID

    Nullable<UInt64> after

    Gets guilds after ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordGuild>>

    GetFollowupMessageAsync(String, UInt64)

    Declaration
    public Task<DiscordMessage> GetFollowupMessageAsync(string interactionToken, ulong messageId)
    Parameters
    Type Name Description
    String interactionToken
    UInt64 messageId
    Returns
    Type Description
    Task<DiscordMessage>

    GetGlobalApplicationCommandAsync(UInt64)

    Gets a global application command by its ID.

    Declaration
    public Task<DiscordApplicationCommand> GetGlobalApplicationCommandAsync(ulong commandId)
    Parameters
    Type Name Description
    UInt64 commandId

    The ID of the command to get.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The command with the ID.

    GetGlobalApplicationCommandsAsync()

    Gets all the global application commands for this application.

    Declaration
    public Task<IReadOnlyList<DiscordApplicationCommand>> GetGlobalApplicationCommandsAsync()
    Returns
    Type Description
    Task<IReadOnlyList<DiscordApplicationCommand>>

    A list of global application commands.

    GetGuildApplicationCommandAsync(UInt64, UInt64)

    Gets a application command in a guild by its ID.

    Declaration
    public Task<DiscordApplicationCommand> GetGuildApplicationCommandAsync(ulong guildId, ulong commandId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild the application command is in.

    UInt64 commandId

    The ID of the command to get.

    Returns
    Type Description
    Task<DiscordApplicationCommand>

    The command with the ID.

    GetGuildApplicationCommandPermissionsAsync(UInt64, UInt64)

    Gets permissions for a application command in a guild.

    Declaration
    public Task<DiscordGuildApplicationCommandPermissions> GetGuildApplicationCommandPermissionsAsync(ulong guildId, ulong commandId)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild ID.

    UInt64 commandId

    The ID of the command to get them for.

    Returns
    Type Description
    Task<DiscordGuildApplicationCommandPermissions>

    The permissions.

    GetGuildApplicationCommandsAsync(UInt64)

    Gets all the application commands for a guild.

    Declaration
    public Task<IReadOnlyList<DiscordApplicationCommand>> GetGuildApplicationCommandsAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild to get application commands for.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordApplicationCommand>>

    A list of application commands in the guild.

    GetGuildApplicationCommandsPermissionsAsync(UInt64)

    Gets all application command permissions in a guild.

    Declaration
    public Task<IReadOnlyList<DiscordGuildApplicationCommandPermissions>> GetGuildApplicationCommandsPermissionsAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild ID.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordGuildApplicationCommandPermissions>>

    A list of permissions.

    GetGuildAsync(UInt64, Nullable<Boolean>)

    Gets a guild.

    Declaration
    public Task<DiscordGuild> GetGuildAsync(ulong guild_id, bool? with_counts = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    The guild ID to search for.

    Nullable<Boolean> with_counts

    Whether to include approximate presence and member counts in the returned guild.

    Returns
    Type Description
    Task<DiscordGuild>

    GetGuildBanAsync(UInt64, UInt64)

    Gets the ban of the specified user. Requires Ban Members permission.

    Declaration
    public Task<DiscordBan> GetGuildBanAsync(ulong guild_id, ulong user_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    The ID of the guild to get the ban from.

    UInt64 user_id

    The ID of the user to get the ban for.

    Returns
    Type Description
    Task<DiscordBan>

    A guild ban object.

    GetGuildBansAsync(UInt64, Nullable<Int32>, Nullable<UInt64>, Nullable<UInt64>)

    Gets guild bans.

    Declaration
    public Task<IReadOnlyList<DiscordBan>> GetGuildBansAsync(ulong guild_id, int? limit = null, ulong? before = null, ulong? after = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    The ID of the guild to get the bans from.

    Nullable<Int32> limit

    The number of users to return (up to maximum 1000, default 1000).

    Nullable<UInt64> before

    Consider only users before the given user ID.

    Nullable<UInt64> after

    Consider only users after the given user ID.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordBan>>

    A collection of the guild's bans.

    GetGuildChannelsAsync(UInt64)

    Gets channels from a guild

    Declaration
    public Task<IReadOnlyList<DiscordChannel>> GetGuildChannelsAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordChannel>>

    GetGuildEmojiAsync(UInt64, UInt64)

    Gets a guild emoji.

    Declaration
    public Task<DiscordGuildEmoji> GetGuildEmojiAsync(ulong guildId, ulong emojiId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 emojiId

    The ID of the emoji.

    Returns
    Type Description
    Task<DiscordGuildEmoji>

    GetGuildEmojisAsync(UInt64)

    Gets a guild's emojis.

    Declaration
    public Task<IReadOnlyList<DiscordGuildEmoji>> GetGuildEmojisAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordGuildEmoji>>

    GetGuildIntegrationsAsync(UInt64)

    Gets guild integrations

    Declaration
    public Task<IReadOnlyList<DiscordIntegration>> GetGuildIntegrationsAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordIntegration>>

    GetGuildInvitesAsync(UInt64)

    Get a guild's invites

    Declaration
    public Task<IReadOnlyList<DiscordInvite>> GetGuildInvitesAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordInvite>>

    GetGuildMemberAsync(UInt64, UInt64)

    Gets guild member

    Declaration
    public Task<DiscordMember> GetGuildMemberAsync(ulong guild_id, ulong member_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 member_id

    Member ID

    Returns
    Type Description
    Task<DiscordMember>

    GetGuildMembershipScreeningFormAsync(UInt64)

    Gets a guild's membership screening form.

    Declaration
    public Task<DiscordGuildMembershipScreening> GetGuildMembershipScreeningFormAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<DiscordGuildMembershipScreening>

    The guild's membership screening form.

    GetGuildPreviewAsync(UInt64)

    Gets a guild preview.

    Declaration
    public Task<DiscordGuildPreview> GetGuildPreviewAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    Returns
    Type Description
    Task<DiscordGuildPreview>

    GetGuildPruneCountAsync(UInt64, Int32, IEnumerable<UInt64>)

    Get a guild's prune count.

    Declaration
    public Task<int> GetGuildPruneCountAsync(ulong guild_id, int days, IEnumerable<ulong> include_roles)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Int32 days

    Days to check for

    IEnumerable<UInt64> include_roles

    The roles to be included in the prune.

    Returns
    Type Description
    Task<Int32>

    GetGuildRolesAsync(UInt64)

    Gets roles

    Declaration
    public Task<IReadOnlyList<DiscordRole>> GetGuildRolesAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordRole>>

    GetGuildStickerAsync(UInt64, UInt64)

    Gets a sticker from a guild.

    Declaration
    public Task<DiscordMessageSticker> GetGuildStickerAsync(ulong guildId, ulong stickerId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 stickerId

    The ID of the sticker.

    Returns
    Type Description
    Task<DiscordMessageSticker>

    GetGuildStickersAsync(UInt64)

    Gets a list of stickers from a guild.

    Declaration
    public Task<IReadOnlyList<DiscordMessageSticker>> GetGuildStickersAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordMessageSticker>>

    GetGuildTemplatesAsync(UInt64)

    Gets a guild's templates.

    Declaration
    public Task<IReadOnlyList<DiscordGuildTemplate>> GetGuildTemplatesAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordGuildTemplate>>

    All of the guild's templates.

    GetGuildVanityUrlAsync(UInt64)

    Gets a guild's vanity url

    Declaration
    public Task<DiscordInvite> GetGuildVanityUrlAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    Returns
    Type Description
    Task<DiscordInvite>

    The guild's vanity url.

    GetGuildVoiceRegionsAsync(UInt64)

    Get a guild's voice region

    Declaration
    public Task<IReadOnlyList<DiscordVoiceRegion>> GetGuildVoiceRegionsAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordVoiceRegion>>

    GetGuildWebhooksAsync(UInt64)

    Gets all webhooks from a guild

    Declaration
    public Task<IReadOnlyList<DiscordWebhook>> GetGuildWebhooksAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordWebhook>>

    GetGuildWelcomeScreenAsync(UInt64)

    Gets a guild's welcome screen.

    Declaration
    public Task<DiscordGuildWelcomeScreen> GetGuildWelcomeScreenAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId
    Returns
    Type Description
    Task<DiscordGuildWelcomeScreen>

    The guild's welcome screen object.

    GetGuildWidgetAsync(UInt64)

    Gets a guild's widget

    Declaration
    public Task<DiscordWidget> GetGuildWidgetAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<DiscordWidget>

    GetGuildWidgetSettingsAsync(UInt64)

    Gets a guild's widget settings

    Declaration
    public Task<DiscordWidgetSettings> GetGuildWidgetSettingsAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task<DiscordWidgetSettings>

    GetInviteAsync(String, Nullable<Boolean>, Nullable<Boolean>)

    Gets an invite.

    Declaration
    public Task<DiscordInvite> GetInviteAsync(string invite_code, bool? withCounts = null, bool? withExpiration = null)
    Parameters
    Type Name Description
    String invite_code

    The invite code.

    Nullable<Boolean> withCounts

    Whether to include presence and total member counts in the returned invite.

    Nullable<Boolean> withExpiration

    Whether to include the expiration date in the returned invite.

    Returns
    Type Description
    Task<DiscordInvite>

    GetMessageAsync(UInt64, UInt64)

    Gets message in a channel

    Declaration
    public Task<DiscordMessage> GetMessageAsync(ulong channel_id, ulong message_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Returns
    Type Description
    Task<DiscordMessage>

    GetOriginalInteractionResponseAsync(String)

    Gets the original interaction response.

    Declaration
    public Task<DiscordMessage> GetOriginalInteractionResponseAsync(string interactionToken)
    Parameters
    Type Name Description
    String interactionToken
    Returns
    Type Description
    Task<DiscordMessage>

    The original message that was sent. This does not work on ephemeral messages.

    GetPinnedMessagesAsync(UInt64)

    Gets pinned messages

    Declaration
    public Task<IReadOnlyList<DiscordMessage>> GetPinnedMessagesAsync(ulong channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordMessage>>

    GetReactionsAsync(UInt64, UInt64, DiscordEmoji, Nullable<UInt64>, Int32)

    Gets all users that reacted with a specific emoji to a message

    Declaration
    public Task<IReadOnlyList<DiscordUser>> GetReactionsAsync(ulong channel_id, ulong message_id, DiscordEmoji emoji, ulong? after_id = null, int limit = 25)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    DiscordEmoji emoji

    Emoji to check for

    Nullable<UInt64> after_id

    Whether to search for reactions after this message id.

    Int32 limit

    The maximum amount of reactions to fetch.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordUser>>

    GetReactionsAsync(UInt64, UInt64, String, Nullable<UInt64>, Int32)

    Gets all users that reacted with a specific emoji to a message

    Declaration
    public Task<IReadOnlyList<DiscordUser>> GetReactionsAsync(ulong channel_id, ulong message_id, string emoji, ulong? after_id = null, int limit = 25)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    String emoji

    Emoji to check for

    Nullable<UInt64> after_id

    Whether to search for reactions after this message id.

    Int32 limit

    The maximum amount of reactions to fetch.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordUser>>

    GetScheduledGuildEventAsync(UInt64, UInt64)

    Gets a specific scheduled guild event.

    Declaration
    public Task<DiscordScheduledGuildEvent> GetScheduledGuildEventAsync(ulong guildId, ulong eventId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild the event resides on.

    UInt64 eventId

    The ID of the event to get

    Returns
    Type Description
    Task<DiscordScheduledGuildEvent>

    The requested event.

    GetScheduledGuildEventsAsync(UInt64)

    Gets all available scheduled guild events.

    Declaration
    public Task<IReadOnlyList<DiscordScheduledGuildEvent>> GetScheduledGuildEventsAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild to query.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordScheduledGuildEvent>>

    All active and scheduled events.

    GetScheduledGuildEventUsersAsync(UInt64, UInt64, Int32, Nullable<UInt64>, Nullable<UInt64>)

    Gets the users interested in the guild event.

    Declaration
    public async Task<IReadOnlyList<DiscordUser>> GetScheduledGuildEventUsersAsync(ulong guildId, ulong eventId, int limit = 100, ulong? after = null, ulong? before = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild the event resides on.

    UInt64 eventId

    The ID of the event.

    Int32 limit

    How many users to query.

    Nullable<UInt64> after

    Fetch users after this ID.

    Nullable<UInt64> before

    Fetch users before this ID.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordUser>>

    The users interested in the event.

    GetStageInstanceAsync(UInt64)

    Gets a stage instance in a stage channel.

    Declaration
    public Task<DiscordStageInstance> GetStageInstanceAsync(ulong channelId)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel.

    Returns
    Type Description
    Task<DiscordStageInstance>

    The stage instance in the channel.

    GetStickerAsync(UInt64)

    Gets a sticker by its ID.

    Declaration
    public Task<DiscordMessageSticker> GetStickerAsync(ulong stickerId)
    Parameters
    Type Name Description
    UInt64 stickerId

    The ID of the sticker.

    Returns
    Type Description
    Task<DiscordMessageSticker>

    GetStickerPacksAsync()

    Gets a collection of sticker packs that may be used by nitro users.

    Declaration
    public Task<IReadOnlyList<DiscordMessageStickerPack>> GetStickerPacksAsync()
    Returns
    Type Description
    Task<IReadOnlyList<DiscordMessageStickerPack>>

    GetTemplateAsync(String)

    Gets a guild template by the code.

    Declaration
    public Task<DiscordGuildTemplate> GetTemplateAsync(string code)
    Parameters
    Type Name Description
    String code

    The code of the template.

    Returns
    Type Description
    Task<DiscordGuildTemplate>

    The guild template for the code.

    GetUserAsync(UInt64)

    Gets user object

    Declaration
    public Task<DiscordUser> GetUserAsync(ulong user)
    Parameters
    Type Name Description
    UInt64 user

    User ID

    Returns
    Type Description
    Task<DiscordUser>

    GetUsersConnectionsAsync()

    Gets current user's connections

    Declaration
    public Task<IReadOnlyList<DiscordConnection>> GetUsersConnectionsAsync()
    Returns
    Type Description
    Task<IReadOnlyList<DiscordConnection>>

    GetWebhookAsync(UInt64)

    Gets a webhook

    Declaration
    public Task<DiscordWebhook> GetWebhookAsync(ulong webhook_id)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    Returns
    Type Description
    Task<DiscordWebhook>

    GetWebhookWithTokenAsync(UInt64, String)

    Gets a webhook with its token (when user is not in said guild)

    Declaration
    public Task<DiscordWebhook> GetWebhookWithTokenAsync(ulong webhook_id, string webhook_token)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String webhook_token

    Webhook token

    Returns
    Type Description
    Task<DiscordWebhook>

    GroupDmAddRecipientAsync(UInt64, UInt64, String, String)

    Adds a member to a group DM

    Declaration
    public Task GroupDmAddRecipientAsync(ulong channel_id, ulong user_id, string access_token, string nickname)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 user_id

    User ID

    String access_token

    User's access token

    String nickname

    Nickname for user

    Returns
    Type Description
    Task

    GroupDmRemoveRecipientAsync(UInt64, UInt64)

    Removes a member from a group DM

    Declaration
    public Task GroupDmRemoveRecipientAsync(ulong channel_id, ulong user_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 user_id

    User ID

    Returns
    Type Description
    Task

    InitializeCacheAsync()

    Initializes cache

    Declaration
    public async Task InitializeCacheAsync()
    Returns
    Type Description
    Task

    JoinGroupDmAsync(UInt64, String)

    Joins a group DM

    Declaration
    public Task JoinGroupDmAsync(ulong channel_id, string nickname)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    String nickname

    DM nickname

    Returns
    Type Description
    Task

    JoinThreadAsync(UInt64)

    Joins a thread.

    Declaration
    public Task JoinThreadAsync(ulong threadId)
    Parameters
    Type Name Description
    UInt64 threadId

    The ID of the thread.

    Returns
    Type Description
    Task

    LeaveGroupDmAsync(UInt64)

    Leaves a group DM

    Declaration
    public Task LeaveGroupDmAsync(ulong channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Returns
    Type Description
    Task

    LeaveGuildAsync(UInt64)

    Leaves a guild

    Declaration
    public Task LeaveGuildAsync(ulong guild_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Returns
    Type Description
    Task

    LeaveThreadAsync(UInt64)

    Leaves a thread.

    Declaration
    public Task LeaveThreadAsync(ulong threadId)
    Parameters
    Type Name Description
    UInt64 threadId

    The ID of the thread.

    Returns
    Type Description
    Task

    ListActiveThreadAsync(UInt64)

    Lists the active threads of a guild.

    Declaration
    public Task<ThreadQueryResult> ListActiveThreadAsync(ulong guildId)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    Returns
    Type Description
    Task<ThreadQueryResult>

    ListGuildMembersAsync(UInt64, Nullable<Int32>, Nullable<UInt64>)

    Gets all guild members

    Declaration
    public async Task<IReadOnlyList<DiscordMember>> ListGuildMembersAsync(ulong guild_id, int? limit, ulong? after)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Nullable<Int32> limit

    Member download limit

    Nullable<UInt64> after

    Gets members after this ID

    Returns
    Type Description
    Task<IReadOnlyList<DiscordMember>>

    ListJoinedPrivateArchivedThreadsAsync(UInt64, UInt64, Nullable<DateTimeOffset>, Int32)

    Gets the private archived threads the user has joined for a channel.

    Declaration
    public Task<ThreadQueryResult> ListJoinedPrivateArchivedThreadsAsync(ulong guildId, ulong channelId, DateTimeOffset? before = null, int limit = 0)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 channelId

    The ID of the channel.

    Nullable<DateTimeOffset> before

    Date to filter by.

    Int32 limit

    Limit.

    Returns
    Type Description
    Task<ThreadQueryResult>

    ListPrivateArchivedThreadAsync(UInt64, UInt64, Nullable<DateTimeOffset>, Int32)

    Gets the threads that are public and archived for a channel.

    Declaration
    public Task<ThreadQueryResult> ListPrivateArchivedThreadAsync(ulong guildId, ulong channelId, DateTimeOffset? before = null, int limit = 0)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 channelId

    The ID of the channel.

    Nullable<DateTimeOffset> before

    Date to filter by.

    Int32 limit

    Limit.

    Returns
    Type Description
    Task<ThreadQueryResult>

    ListPublicArchivedThreadsAsync(UInt64, UInt64, Nullable<DateTimeOffset>, Int32)

    Gets the threads that are public and archived for a channel.

    Declaration
    public Task<ThreadQueryResult> ListPublicArchivedThreadsAsync(ulong guildId, ulong channelId, DateTimeOffset? before = null, int limit = 0)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 channelId

    The ID of the channel.

    Nullable<DateTimeOffset> before

    Date to filter by.

    Int32 limit

    Limit.

    Returns
    Type Description
    Task<ThreadQueryResult>

    ListThreadMembersAsync(UInt64)

    Lists the members of a thread.

    Declaration
    public Task<IReadOnlyList<DiscordThreadChannelMember>> ListThreadMembersAsync(ulong threadId)
    Parameters
    Type Name Description
    UInt64 threadId

    The ID of the thread.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordThreadChannelMember>>

    ModifyAsync(UInt64, UInt64, Action<MemberEditModel>)

    Modifies a member

    Declaration
    public async Task ModifyAsync(ulong member_id, ulong guild_id, Action<MemberEditModel> action)
    Parameters
    Type Name Description
    UInt64 member_id

    Member ID

    UInt64 guild_id

    Guild ID

    Action<MemberEditModel> action

    Modifications

    Returns
    Type Description
    Task

    ModifyChannelAsync(UInt64, Action<ChannelEditModel>)

    Modifies a channel

    Declaration
    public Task ModifyChannelAsync(ulong channelId, Action<ChannelEditModel> action)
    Parameters
    Type Name Description
    UInt64 channelId

    Channel ID

    Action<ChannelEditModel> action

    Channel modifications

    Returns
    Type Description
    Task

    ModifyChannelAsync(UInt64, String, Nullable<Int32>, Optional<String>, Nullable<Boolean>, Optional<Nullable<UInt64>>, Nullable<Int32>, Nullable<Int32>, Optional<Nullable<Int32>>, Optional<DiscordVoiceRegion>, Nullable<VideoQualityMode>, Optional<ChannelType>, IEnumerable<DiscordOverwriteBuilder>, String)

    Modifies a channel

    Declaration
    public Task ModifyChannelAsync(ulong id, string name, int? position, Optional<string> topic, bool? nsfw, Optional<ulong?> parent, int? bitrate, int? userLimit, Optional<int?> perUserRateLimit, Optional<DiscordVoiceRegion> rtcRegion, VideoQualityMode? qualityMode, Optional<ChannelType> type, IEnumerable<DiscordOverwriteBuilder> permissionOverwrites, string reason)
    Parameters
    Type Name Description
    UInt64 id

    Channel ID

    String name

    New channel name

    Nullable<Int32> position

    New channel position

    Optional<String> topic

    New channel topic

    Nullable<Boolean> nsfw

    Whether this channel should be marked as NSFW

    Optional<Nullable<UInt64>> parent

    New channel parent

    Nullable<Int32> bitrate

    New voice channel bitrate

    Nullable<Int32> userLimit

    New voice channel user limit

    Optional<Nullable<Int32>> perUserRateLimit

    Slow mode timeout for users.

    Optional<DiscordVoiceRegion> rtcRegion

    New region override.

    Nullable<VideoQualityMode> qualityMode

    New video quality mode.

    Optional<ChannelType> type

    New channel type.

    IEnumerable<DiscordOverwriteBuilder> permissionOverwrites

    New channel permission overwrites.

    String reason

    Reason why this channel was modified

    Returns
    Type Description
    Task

    ModifyCurrentMemberAsync(UInt64, String, String)

    Changes the current user in a guild.

    Declaration
    public Task ModifyCurrentMemberAsync(ulong guild_id, string nickname, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String nickname

    Nickname to set

    String reason

    Audit log reason

    Returns
    Type Description
    Task

    ModifyCurrentMemberNicknameAsync(UInt64, String, String)

    Changes current user's nickname

    Declaration
    public Task ModifyCurrentMemberNicknameAsync(ulong guild_id, string nick, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String nick

    Nickname

    String reason

    Reason why you set it to this

    Returns
    Type Description
    Task

    ModifyCurrentUserAsync(String, Stream)

    Modifies current user

    Declaration
    public async Task<DiscordUser> ModifyCurrentUserAsync(string username = null, Stream avatar = null)
    Parameters
    Type Name Description
    String username

    username

    Stream avatar

    avatar

    Returns
    Type Description
    Task<DiscordUser>

    ModifyCurrentUserAsync(String, String)

    Modifies current user

    Declaration
    public async Task<DiscordUser> ModifyCurrentUserAsync(string username, string base64_avatar)
    Parameters
    Type Name Description
    String username

    New username

    String base64_avatar

    New avatar (base64)

    Returns
    Type Description
    Task<DiscordUser>

    ModifyEmbedSuppressionAsync(UInt64, UInt64, Boolean)

    Modifes the visibility of embeds in a message.

    Declaration
    public Task ModifyEmbedSuppressionAsync(ulong channel_id, ulong message_id, bool hideEmbeds)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Boolean hideEmbeds

    Whether to hide all embeds.

    Returns
    Type Description
    Task

    ModifyGuildAsync(UInt64, Action<GuildEditModel>)

    Modifies a guild

    Declaration
    public async Task<DiscordGuild> ModifyGuildAsync(ulong guild_id, Action<GuildEditModel> action)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Action<GuildEditModel> action

    Guild modifications

    Returns
    Type Description
    Task<DiscordGuild>

    ModifyGuildAsync(UInt64, Optional<String>, Optional<String>, Optional<VerificationLevel>, Optional<DefaultMessageNotifications>, Optional<MfaLevel>, Optional<ExplicitContentFilter>, Optional<Nullable<UInt64>>, Optional<Int32>, Optional<String>, Optional<UInt64>, Optional<String>, Optional<Nullable<UInt64>>, Optional<String>, Optional<String>, Optional<String>, Optional<IEnumerable<String>>, Optional<String>, Optional<Nullable<UInt64>>, Optional<Nullable<UInt64>>, Optional<SystemChannelFlags>, String)

    Modifies a guild

    Declaration
    public Task<DiscordGuild> ModifyGuildAsync(ulong guild_id, Optional<string> name, Optional<string> region, Optional<VerificationLevel> verification_level, Optional<DefaultMessageNotifications> default_message_notifications, Optional<MfaLevel> mfa_level, Optional<ExplicitContentFilter> explicit_content_filter, Optional<ulong?> afk_channel_id, Optional<int> afk_timeout, Optional<string> iconb64, Optional<ulong> owner_id, Optional<string> splashb64, Optional<ulong?> systemChannelId, Optional<string> banner, Optional<string> description, Optional<string> discorverySplash, Optional<IEnumerable<string>> features, Optional<string> preferredLocale, Optional<ulong?> publicUpdatesChannelId, Optional<ulong?> rulesChannelId, Optional<SystemChannelFlags> systemChannelFlags, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Optional<String> name

    New guild Name

    Optional<String> region

    New guild voice region

    Optional<VerificationLevel> verification_level

    New guild verification level

    Optional<DefaultMessageNotifications> default_message_notifications

    New guild default message notification level

    Optional<MfaLevel> mfa_level

    New guild MFA level

    Optional<ExplicitContentFilter> explicit_content_filter

    New guild explicit content filter level

    Optional<Nullable<UInt64>> afk_channel_id

    New guild AFK channel ID

    Optional<Int32> afk_timeout

    New guild AFK timeout in seconds

    Optional<String> iconb64

    New guild icon (base64)

    Optional<UInt64> owner_id

    New guild owner ID

    Optional<String> splashb64

    New guild splash (base64)

    Optional<Nullable<UInt64>> systemChannelId

    New guild system channel ID

    Optional<String> banner

    New guild banner

    Optional<String> description

    New guild description

    Optional<String> discorverySplash

    New guild Discovery splash

    Optional<IEnumerable<String>> features

    List of new guild features

    Optional<String> preferredLocale

    New preferred locale

    Optional<Nullable<UInt64>> publicUpdatesChannelId

    New updates channel ID

    Optional<Nullable<UInt64>> rulesChannelId

    New rules channel ID

    Optional<SystemChannelFlags> systemChannelFlags

    New system channel flags

    String reason

    Modify reason

    Returns
    Type Description
    Task<DiscordGuild>

    ModifyGuildEmojiAsync(UInt64, UInt64, String, IEnumerable<UInt64>, String)

    Modifies a guild's emoji.

    Declaration
    public Task<DiscordGuildEmoji> ModifyGuildEmojiAsync(ulong guildId, ulong emojiId, string name, IEnumerable<ulong> roles = null, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 emojiId

    The ID of the emoji.

    String name

    New name of the emoji.

    IEnumerable<UInt64> roles

    Roles for which the emoji will be available.

    String reason

    Reason for audit logs.

    Returns
    Type Description
    Task<DiscordGuildEmoji>

    ModifyGuildIntegrationAsync(UInt64, UInt64, Int32, Int32, Boolean)

    Modifies a guild integration

    Declaration
    public Task<DiscordIntegration> ModifyGuildIntegrationAsync(ulong guild_id, ulong integration_id, int expire_behaviour, int expire_grace_period, bool enable_emoticons)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 integration_id

    Integration ID

    Int32 expire_behaviour

    Expiration behaviour

    Int32 expire_grace_period

    Expiration grace period

    Boolean enable_emoticons

    Whether to enable emojis for this integration

    Returns
    Type Description
    Task<DiscordIntegration>

    ModifyGuildMemberAsync(UInt64, UInt64, Optional<String>, Optional<IEnumerable<UInt64>>, Optional<Boolean>, Optional<Boolean>, Optional<Nullable<UInt64>>, Optional<Nullable<DateTimeOffset>>, String)

    Modifies guild member.

    Declaration
    public Task ModifyGuildMemberAsync(ulong guild_id, ulong user_id, Optional<string> nick, Optional<IEnumerable<ulong>> role_ids, Optional<bool> mute, Optional<bool> deaf, Optional<ulong?> voice_channel_id, Optional<DateTimeOffset?> communication_disabled_until, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    Optional<String> nick

    New nickname

    Optional<IEnumerable<UInt64>> role_ids

    New roles

    Optional<Boolean> mute

    Whether this user should be muted

    Optional<Boolean> deaf

    Whether this user should be deafened

    Optional<Nullable<UInt64>> voice_channel_id

    Voice channel to move this user to

    Optional<Nullable<DateTimeOffset>> communication_disabled_until

    How long this member should be timed out for. Requires MODERATE_MEMBERS permission.

    String reason

    Reason this user was modified

    Returns
    Type Description
    Task

    ModifyGuildMembershipScreeningFormAsync(UInt64, Action<MembershipScreeningEditModel>)

    Modifies a guild's membership screening form.

    Declaration
    public async Task<DiscordGuildMembershipScreening> ModifyGuildMembershipScreeningFormAsync(ulong guild_id, Action<MembershipScreeningEditModel> action)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Action<MembershipScreeningEditModel> action

    Action to perform

    Returns
    Type Description
    Task<DiscordGuildMembershipScreening>

    The modified screening form.

    ModifyGuildRoleAsync(UInt64, UInt64, Action<RoleEditModel>)

    Modifies a role

    Declaration
    public Task ModifyGuildRoleAsync(ulong role_id, ulong guild_id, Action<RoleEditModel> action)
    Parameters
    Type Name Description
    UInt64 role_id

    Role ID

    UInt64 guild_id

    Guild ID

    Action<RoleEditModel> action

    Modifications

    Returns
    Type Description
    Task

    ModifyGuildRoleAsync(UInt64, UInt64, String, Nullable<Permissions>, Nullable<DiscordColor>, Nullable<Boolean>, Nullable<Boolean>, String, Stream, DiscordEmoji)

    Modifies a role

    Declaration
    public Task<DiscordRole> ModifyGuildRoleAsync(ulong guild_id, ulong role_id, string name, Permissions? permissions, DiscordColor? color, bool? hoist, bool? mentionable, string reason, Stream icon, DiscordEmoji emoji)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 role_id

    Role ID

    String name

    New role name

    Nullable<Permissions> permissions

    New role permissions

    Nullable<DiscordColor> color

    New role color

    Nullable<Boolean> hoist

    Whether this role should be hoisted

    Nullable<Boolean> mentionable

    Whether this role should be mentionable

    String reason

    Why this role was modified

    Stream icon

    The icon to add to this role

    DiscordEmoji emoji

    The emoji to add to this role. Must be unicode.

    Returns
    Type Description
    Task<DiscordRole>

    ModifyGuildStickerAsync(UInt64, UInt64, Action<StickerEditModel>, String)

    Modifies a sticker in a guild.

    Declaration
    public Task<DiscordMessageSticker> ModifyGuildStickerAsync(ulong guildId, ulong stickerId, Action<StickerEditModel> action, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 stickerId

    The ID of the sticker.

    Action<StickerEditModel> action

    Action to perform.

    String reason

    Reason for audit log.

    Returns
    Type Description
    Task<DiscordMessageSticker>

    ModifyGuildTemplateAsync(UInt64, String, String, String)

    Modifies the template's metadata.

    Declaration
    public Task<DiscordGuildTemplate> ModifyGuildTemplateAsync(ulong guild_id, string code, string name = null, string description = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String code

    The template's code.

    String name

    Name of the template.

    String description

    Description of the template.

    Returns
    Type Description
    Task<DiscordGuildTemplate>

    The template modified.

    ModifyGuildWelcomeScreenAsync(UInt64, Action<WelcomeScreenEditModel>, String)

    Modifies a guild's welcome screen.

    Declaration
    public async Task<DiscordGuildWelcomeScreen> ModifyGuildWelcomeScreenAsync(ulong guildId, Action<WelcomeScreenEditModel> action, string reason = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The guild ID to modify.

    Action<WelcomeScreenEditModel> action

    Action to perform.

    String reason

    The audit log reason for this action.

    Returns
    Type Description
    Task<DiscordGuildWelcomeScreen>

    The modified welcome screen.

    ModifyGuildWidgetSettingsAsync(UInt64, Nullable<Boolean>, Nullable<UInt64>, String)

    Modifies a guild's widget settings

    Declaration
    public Task<DiscordWidgetSettings> ModifyGuildWidgetSettingsAsync(ulong guild_id, bool? enabled = null, ulong? channel_id = null, string reason = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    Nullable<Boolean> enabled

    If the widget is enabled or not

    Nullable<UInt64> channel_id

    Widget channel ID

    String reason

    Reason the widget settings were modified

    Returns
    Type Description
    Task<DiscordWidgetSettings>

    ModifyScheduledGuildEventAsync(UInt64, UInt64, Action<ScheduledGuildEventEditModel>)

    Modify a scheduled guild event.

    Declaration
    public Task<DiscordScheduledGuildEvent> ModifyScheduledGuildEventAsync(ulong guildId, ulong eventId, Action<ScheduledGuildEventEditModel> mdl)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild the event resides on.

    UInt64 eventId

    The ID of the event to modify.

    Action<ScheduledGuildEventEditModel> mdl

    The action to apply to the event.

    Returns
    Type Description
    Task<DiscordScheduledGuildEvent>

    The modified event.

    ModifyStageInstanceAsync(UInt64, Action<StageInstanceEditModel>)

    Modifies a stage instance in a stage channel.

    Declaration
    public async Task<DiscordStageInstance> ModifyStageInstanceAsync(ulong channelId, Action<StageInstanceEditModel> action)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel to modify the stage instance of.

    Action<StageInstanceEditModel> action

    Action to perform.

    Returns
    Type Description
    Task<DiscordStageInstance>

    The modified stage instance.

    ModifyWebhookAsync(UInt64, String, Stream, String, String)

    Modifies a webhook (when user is not in said guild)

    Declaration
    public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, string name, Stream avatar, string webhook_token, string reason)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String name

    New webhook name

    Stream avatar

    New webhook avatar

    String webhook_token

    Webhook token

    String reason

    Reason why this webhook was modified

    Returns
    Type Description
    Task<DiscordWebhook>

    ModifyWebhookAsync(UInt64, String, String, String, String)

    Modifies a webhook (when user is not in said guild)

    Declaration
    public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, string name, string base64_avatar, string webhook_token, string reason)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    String name

    New webhook name

    String base64_avatar

    New webhook avatar (base64)

    String webhook_token

    Webhook token

    String reason

    Reason why this webhook was modified

    Returns
    Type Description
    Task<DiscordWebhook>

    ModifyWebhookAsync(UInt64, UInt64, String, Stream, String)

    Modifies a webhook

    Declaration
    public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, ulong channelId, string name, Stream avatar, string reason)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    UInt64 channelId

    The new channel ID the webhook should be moved to.

    String name

    New webhook name

    Stream avatar

    New webhook avatar

    String reason

    Reason why this webhook was modified

    Returns
    Type Description
    Task<DiscordWebhook>

    ModifyWebhookAsync(UInt64, UInt64, String, String, String)

    Modifies a webhook

    Declaration
    public Task<DiscordWebhook> ModifyWebhookAsync(ulong webhook_id, ulong channelId, string name, string base64_avatar, string reason)
    Parameters
    Type Name Description
    UInt64 webhook_id

    Webhook ID

    UInt64 channelId

    The new channel ID the webhook should be moved to.

    String name

    New webhook name

    String base64_avatar

    New webhook avatar (base64)

    String reason

    Reason why this webhook was modified

    Returns
    Type Description
    Task<DiscordWebhook>

    PinMessageAsync(UInt64, UInt64)

    Pins a message.

    Declaration
    public Task PinMessageAsync(ulong channelId, ulong messageId)
    Parameters
    Type Name Description
    UInt64 channelId

    The ID of the channel the message is in.

    UInt64 messageId

    The ID of the message.

    Returns
    Type Description
    Task

    RemoveGuildBanAsync(UInt64, UInt64, String)

    Removes a guild ban

    Declaration
    public Task RemoveGuildBanAsync(ulong guild_id, ulong user_id, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User to unban

    String reason

    Reason why this member was unbanned

    Returns
    Type Description
    Task

    RemoveGuildMemberAsync(UInt64, UInt64, String)

    Removes guild member

    Declaration
    public Task RemoveGuildMemberAsync(ulong guild_id, ulong user_id, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    String reason

    Why this user was removed

    Returns
    Type Description
    Task

    RemoveGuildMemberRoleAsync(UInt64, UInt64, UInt64, String)

    Remove role from member

    Declaration
    public Task RemoveGuildMemberRoleAsync(ulong guild_id, ulong user_id, ulong role_id, string reason)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 user_id

    User ID

    UInt64 role_id

    Role ID

    String reason

    Reason this role gets removed

    Returns
    Type Description
    Task

    RemoveThreadMemberAsync(UInt64, UInt64)

    Removes a member from a thread.

    Declaration
    public Task RemoveThreadMemberAsync(ulong threadId, ulong userId)
    Parameters
    Type Name Description
    UInt64 threadId

    The ID of the thread.

    UInt64 userId

    The ID of the member.

    Returns
    Type Description
    Task

    SearchMembersAsync(UInt64, String, Nullable<Int32>)

    Searches the given guild for members who's display name start with the specified name.

    Declaration
    public Task<IReadOnlyList<DiscordMember>> SearchMembersAsync(ulong guild_id, string name, int? limit = 1)
    Parameters
    Type Name Description
    UInt64 guild_id

    The ID of the guild to search.

    String name

    The name to search for.

    Nullable<Int32> limit

    The maximum amount of members to return. Max 1000. Defaults to 1.

    Returns
    Type Description
    Task<IReadOnlyList<DiscordMember>>

    The members found, if any.

    SyncGuildIntegrationAsync(UInt64, UInt64)

    Syncs guild integration

    Declaration
    public Task SyncGuildIntegrationAsync(ulong guild_id, ulong integration_id)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 integration_id

    Integration ID

    Returns
    Type Description
    Task

    SyncGuildTemplateAsync(UInt64, String)

    Syncs the template to the current guild's state.

    Declaration
    public Task<DiscordGuildTemplate> SyncGuildTemplateAsync(ulong guild_id, string code)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    String code

    The code of the template to sync.

    Returns
    Type Description
    Task<DiscordGuildTemplate>

    The template synced.

    TriggerTypingAsync(UInt64)

    Send a typing indicator to a channel

    Declaration
    public Task TriggerTypingAsync(ulong channel_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    Returns
    Type Description
    Task

    UnpinMessageAsync(UInt64, UInt64)

    Unpuns a message

    Declaration
    public Task UnpinMessageAsync(ulong channel_id, ulong message_id)
    Parameters
    Type Name Description
    UInt64 channel_id

    Channel ID

    UInt64 message_id

    Message ID

    Returns
    Type Description
    Task

    UpdateChannelPositionAsync(UInt64, UInt64, Int32, String, Nullable<Boolean>, Nullable<UInt64>)

    Updates a channel's position

    Declaration
    public Task UpdateChannelPositionAsync(ulong guild_id, ulong channel_id, int position, string reason, bool? lockPermissions = null, ulong? parentId = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 channel_id

    Channel ID

    Int32 position

    Channel position

    String reason

    Reason this position was modified

    Nullable<Boolean> lockPermissions

    Whether to sync channel permissions with the parent, if moving to a new category.

    Nullable<UInt64> parentId

    The new parent id if the channel is to be moved to a new category.

    Returns
    Type Description
    Task

    UpdateCurrentUserVoiceStateAsync(UInt64, UInt64, Nullable<Boolean>, Nullable<DateTimeOffset>)

    Updates the current user's suppress state in a stage channel.

    Declaration
    public Task UpdateCurrentUserVoiceStateAsync(ulong guildId, ulong channelId, bool? suppress, DateTimeOffset? requestToSpeakTimestamp = null)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 channelId

    The ID of the channel.

    Nullable<Boolean> suppress

    Toggles the suppress state.

    Nullable<DateTimeOffset> requestToSpeakTimestamp

    Sets the time the user requested to speak.

    Returns
    Type Description
    Task

    UpdateRolePositionAsync(UInt64, UInt64, Int32, String)

    Updates a role's position

    Declaration
    public Task UpdateRolePositionAsync(ulong guild_id, ulong role_id, int position, string reason = null)
    Parameters
    Type Name Description
    UInt64 guild_id

    Guild ID

    UInt64 role_id

    Role ID

    Int32 position

    Role position

    String reason

    Reason this position was modified

    Returns
    Type Description
    Task

    UpdateUserVoiceStateAsync(UInt64, UInt64, UInt64, Nullable<Boolean>)

    Updates a member's suppress state in a stage channel.

    Declaration
    public Task UpdateUserVoiceStateAsync(ulong guildId, ulong userId, ulong channelId, bool? suppress)
    Parameters
    Type Name Description
    UInt64 guildId

    The ID of the guild.

    UInt64 userId

    The ID of the member.

    UInt64 channelId

    The ID of the stage channel.

    Nullable<Boolean> suppress

    Toggles the member's suppress state.

    Returns
    Type Description
    Task
    Back to top © 2016-2022 DSharpPlus Contributors