Search Results for

    Show / Hide Table of Contents

    Class SocketMessageComponent

    Represents a Websocket-based interaction type for Message Components.

    Inheritance
    Object
    SocketEntity<UInt64>
    SocketInteraction
    SocketMessageComponent
    Implements
    IEntity<UInt64>
    IComponentInteraction
    IDiscordInteraction
    ISnowflakeEntity
    IEntity<UInt64>
    Inherited Members
    SocketInteraction.Channel
    SocketInteraction.ChannelId
    SocketInteraction.User
    SocketInteraction.Type
    SocketInteraction.Token
    SocketInteraction.UserLocale
    SocketInteraction.GuildLocale
    SocketInteraction.Version
    SocketInteraction.CreatedAt
    SocketInteraction.IsValidToken
    SocketInteraction.IsDMInteraction
    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 SocketMessageComponent : SocketInteraction, IEntity<ulong>, IComponentInteraction, IDiscordInteraction, ISnowflakeEntity, IEntity<ulong>

    Properties

    | Improve this Doc View Source

    Data

    Gets the data received with this interaction, contains the button that was clicked.

    Declaration
    public SocketMessageComponentData Data { get; }
    Property Value
    Type Description
    SocketMessageComponentData
    | Improve this Doc View Source

    HasResponded

    Declaration
    public override bool HasResponded { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    SocketInteraction.HasResponded
    | Improve this Doc View Source

    Message

    Gets the message that contained the trigger for this interaction.

    Declaration
    public SocketUserMessage Message { get; }
    Property Value
    Type Description
    SocketUserMessage

    Methods

    | Improve this Doc View Source

    DeferAsync(Boolean, RequestOptions)

    Acknowledges this interaction.

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

    true to send this message ephemerally, otherwise false.

    RequestOptions options

    The request options for this async request.

    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

    DeferLoadingAsync(Boolean, RequestOptions)

    Declaration
    public async Task DeferLoadingAsync(bool ephemeral = false, RequestOptions options = null)
    Parameters
    Type Name Description
    Boolean ephemeral
    RequestOptions options
    Returns
    Type Description
    Task
    | 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)
    | Improve this Doc View Source

    UpdateAsync(Action<MessageProperties>, RequestOptions)

    Declaration
    public async Task UpdateAsync(Action<MessageProperties> func, RequestOptions options = null)
    Parameters
    Type Name Description
    Action<MessageProperties> func
    RequestOptions options
    Returns
    Type Description
    Task

    Explicit Interface Implementations

    | Improve this Doc View Source

    IComponentInteraction.Data

    Gets the data received with this component interaction.

    Declaration
    IComponentInteractionData IComponentInteraction.Data { get; }
    Returns
    Type Description
    IComponentInteractionData
    | Improve this Doc View Source

    IComponentInteraction.Message

    Gets the message that contained the trigger for this interaction.

    Declaration
    IUserMessage IComponentInteraction.Message { get; }
    Returns
    Type Description
    IUserMessage
    | Improve this Doc View Source

    IDiscordInteraction.Data

    Gets the data sent within this interaction.

    Declaration
    IDiscordInteractionData IDiscordInteraction.Data { get; }
    Returns
    Type Description
    IDiscordInteractionData

    Implements

    IEntity<TId>
    IComponentInteraction
    IDiscordInteraction
    ISnowflakeEntity
    IEntity<TId>

    Theme

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