Search Results for

    Show / Hide Table of Contents

    Class SocketCommandBase

    Base class for User, Message, and Slash command interactions.

    Inheritance
    Object
    SocketEntity<UInt64>
    SocketInteraction
    SocketCommandBase
    SocketMessageCommand
    SocketSlashCommand
    SocketUserCommand
    Implements
    IEntity<UInt64>
    IDiscordInteraction
    ISnowflakeEntity
    IEntity<UInt64>
    Inherited Members
    SocketInteraction.Channel
    SocketInteraction.ChannelId
    SocketInteraction.User
    SocketInteraction.Type
    SocketInteraction.Token
    SocketInteraction.Data
    SocketInteraction.UserLocale
    SocketInteraction.GuildLocale
    SocketInteraction.Version
    SocketInteraction.CreatedAt
    SocketInteraction.IsValidToken
    SocketInteraction.IsDMInteraction
    SocketInteraction.GuildId
    SocketInteraction.ApplicationId
    SocketInteraction.RespondWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.RespondWithFileAsync(String, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.RespondWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.FollowupWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.FollowupWithFileAsync(String, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.FollowupWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    SocketInteraction.GetOriginalResponseAsync(RequestOptions)
    SocketInteraction.ModifyOriginalResponseAsync(Action<MessageProperties>, RequestOptions)
    SocketInteraction.DeleteOriginalResponseAsync(RequestOptions)
    SocketInteraction.GetChannelAsync(RequestOptions)
    SocketInteraction.IDiscordInteraction.User
    SocketEntity<UInt64>.Id
    Namespace: Discord.WebSocket
    Assembly: Discord.Net.WebSocket.dll
    Syntax
    public class SocketCommandBase : SocketInteraction, IEntity<ulong>, IDiscordInteraction, ISnowflakeEntity, IEntity<ulong>

    Properties

    | Improve this Doc View Source

    CommandId

    Gets the id of the invoked command.

    Declaration
    public ulong CommandId { get; }
    Property Value
    Type Description
    UInt64
    | Improve this Doc View Source

    CommandName

    Gets the name of the invoked command.

    Declaration
    public string CommandName { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    HasResponded

    Declaration
    public override bool HasResponded { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    SocketInteraction.HasResponded

    Methods

    | Improve this Doc View Source

    DeferAsync(Boolean, RequestOptions)

    Acknowledges this interaction with the DeferredChannelMessageWithSource.

    Declaration
    public override async Task DeferAsync(bool ephemeral = false, RequestOptions options = null)
    Parameters
    Type Name Description
    Boolean ephemeral
    RequestOptions options
    Returns
    Type Description
    Task

    A task that represents the asynchronous operation of acknowledging the interaction.

    Overrides
    SocketInteraction.DeferAsync(Boolean, RequestOptions)
    | Improve this Doc View Source

    FollowupAsync(String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Sends a followup message for this interaction.

    Declaration
    public override async Task<RestFollowupMessage> FollowupAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null)
    Parameters
    Type Name Description
    String text

    The text of the message to be sent.

    Embed[] embeds

    A array of embeds to send with this response. Max 10.

    Boolean isTTS

    true if the message should be read out by a text-to-speech reader, otherwise false.

    Boolean ephemeral

    true if the response should be hidden to everyone besides the invoker of the command, otherwise false.

    AllowedMentions allowedMentions

    The allowed mentions for this response.

    MessageComponent components

    A MessageComponent to be sent with this response.

    Embed embed

    A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

    RequestOptions options

    The request options for this response.

    Returns
    Type Description
    Task<RestFollowupMessage>

    The sent message.

    Overrides
    SocketInteraction.FollowupAsync(String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    | Improve this Doc View Source

    FollowupWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Sends a followup message for this interaction.

    Declaration
    public override async Task<RestFollowupMessage> FollowupWithFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null)
    Parameters
    Type Name Description
    IEnumerable<FileAttachment> attachments

    A collection of attachments to upload.

    String text

    The text of the message to be sent.

    Embed[] embeds

    A array of embeds to send with this response. Max 10.

    Boolean isTTS

    true if the message should be read out by a text-to-speech reader, otherwise false.

    Boolean ephemeral

    true if the response should be hidden to everyone besides the invoker of the command, otherwise false.

    AllowedMentions allowedMentions

    The allowed mentions for this response.

    MessageComponent components

    A MessageComponent to be sent with this response.

    Embed embed

    A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

    RequestOptions options

    The request options for this response.

    Returns
    Type Description
    Task<RestFollowupMessage>

    A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.

    Overrides
    SocketInteraction.FollowupWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    | Improve this Doc View Source

    RespondAsync(String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Responds to an Interaction with type ChannelMessageWithSource.

    Declaration
    public override async Task RespondAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null)
    Parameters
    Type Name Description
    String text

    The text of the message to be sent.

    Embed[] embeds

    A array of embeds to send with this response. Max 10.

    Boolean isTTS

    true if the message should be read out by a text-to-speech reader, otherwise false.

    Boolean ephemeral

    true if the response should be hidden to everyone besides the invoker of the command, otherwise false.

    AllowedMentions allowedMentions

    The allowed mentions for this response.

    MessageComponent components

    A MessageComponent to be sent with this response.

    Embed embed

    A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

    RequestOptions options

    The request options for this response.

    Returns
    Type Description
    Task
    Overrides
    SocketInteraction.RespondAsync(String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    | Improve this Doc View Source

    RespondWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Declaration
    public override async Task RespondWithFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null)
    Parameters
    Type Name Description
    IEnumerable<FileAttachment> attachments
    String text
    Embed[] embeds
    Boolean isTTS
    Boolean ephemeral
    AllowedMentions allowedMentions
    MessageComponent components
    Embed embed
    RequestOptions options
    Returns
    Type Description
    Task
    Overrides
    SocketInteraction.RespondWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
    | Improve this Doc View Source

    RespondWithModalAsync(Modal, RequestOptions)

    Responds to this interaction with a Modal.

    Declaration
    public override async Task RespondWithModalAsync(Modal modal, RequestOptions options = null)
    Parameters
    Type Name Description
    Modal modal

    The Modal to respond with.

    RequestOptions options

    The request options for this async request.

    Returns
    Type Description
    Task

    A task that represents the asynchronous operation of responding to the interaction.

    Overrides
    SocketInteraction.RespondWithModalAsync(Modal, RequestOptions)

    Implements

    IEntity<TId>
    IDiscordInteraction
    ISnowflakeEntity
    IEntity<TId>

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.7.2