Search Results for

    Show / Hide Table of Contents

    Interface IDiscordInteraction

    Represents a discord interaction.

    Inherited Members
    ISnowflakeEntity.CreatedAt
    Namespace: Discord
    Assembly: Discord.Net.Core.dll
    Syntax
    public interface IDiscordInteraction : ISnowflakeEntity, IEntity<ulong>

    Properties

    | Improve this Doc View Source

    ApplicationId

    Gets the ID of the application this interaction is for.

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

    ChannelId

    Gets the ID of the channel this interaction was executed in.

    Declaration
    ulong? ChannelId { get; }
    Property Value
    Type Description
    Nullable<UInt64>
    Remarks

    This property returns null if the interaction is a REST ping interaction.

    | Improve this Doc View Source

    Data

    Gets the data sent within this interaction.

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

    GuildId

    Gets the ID of the guild this interaction was executed in.

    Declaration
    ulong? GuildId { get; }
    Property Value
    Type Description
    Nullable<UInt64>
    Remarks

    This property returns null if the interaction was not executed in a guild.

    | Improve this Doc View Source

    GuildLocale

    Gets the preferred locale of the guild this interaction was executed in. null if not executed in a guild.

    Declaration
    string GuildLocale { get; }
    Property Value
    Type Description
    String
    Remarks

    Non-community guilds (With no locale setting available) will have en-US as the default value sent by Discord.

    | Improve this Doc View Source

    HasResponded

    Gets whether or not this interaction has been responded to.

    Declaration
    bool HasResponded { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    This property is locally set -- if you're running multiple bots off the same token then this property won't be in sync with them.

    | Improve this Doc View Source

    Id

    Gets the id of the interaction.

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

    IsDMInteraction

    Gets whether or not this interaction was executed in a dm channel.

    Declaration
    bool IsDMInteraction { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Token

    Gets the continuation token for responding to the interaction.

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

    Type

    Gets the type of this IDiscordInteraction.

    Declaration
    InteractionType Type { get; }
    Property Value
    Type Description
    InteractionType
    | Improve this Doc View Source

    User

    Gets the user who invoked the interaction.

    Declaration
    IUser User { get; }
    Property Value
    Type Description
    IUser
    | Improve this Doc View Source

    UserLocale

    Gets the preferred locale of the invoking User.

    Declaration
    string UserLocale { get; }
    Property Value
    Type Description
    String
    Remarks

    This property returns null if the interaction is a REST ping interaction.

    | Improve this Doc View Source

    Version

    Gets the version of the interaction, always 1.

    Declaration
    int Version { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    DeferAsync(Boolean, RequestOptions)

    Acknowledges this interaction.

    Declaration
    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 deferring the interaction.

    | Improve this Doc View Source

    DeleteOriginalResponseAsync(RequestOptions)

    Deletes the original response to this interaction.

    Declaration
    Task DeleteOriginalResponseAsync(RequestOptions options = null)
    Parameters
    Type Name Description
    RequestOptions options

    The request options for this async request.

    Returns
    Type Description
    Task

    A task that represents an asynchronous deletion operation.

    | Improve this Doc View Source

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

    Sends a followup message for this interaction.

    Declaration
    Task<IUserMessage> 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<IUserMessage>

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

    | Improve this Doc View Source

    FollowupWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Sends a followup message for this interaction.

    Declaration
    Task<IUserMessage> FollowupWithFileAsync(FileAttachment attachment, 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
    FileAttachment attachment

    The attachment containing the file and 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<IUserMessage>

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

    | Improve this Doc View Source

    FollowupWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Sends a followup message for this interaction.

    Declaration
    Task<IUserMessage> FollowupWithFileAsync(Stream fileStream, string fileName, 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
    Stream fileStream

    The file to upload.

    String fileName

    The file name of the attachment.

    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<IUserMessage>

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

    | Improve this Doc View Source

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

    Sends a followup message for this interaction.

    Declaration
    Task<IUserMessage> FollowupWithFileAsync(string filePath, string fileName = null, 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 filePath

    The file to upload.

    String fileName

    The file name of the attachment.

    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<IUserMessage>

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

    | Improve this Doc View Source

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

    Sends a followup message for this interaction.

    Declaration
    Task<IUserMessage> 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<IUserMessage>

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

    | Improve this Doc View Source

    GetOriginalResponseAsync(RequestOptions)

    Gets the original response for this interaction.

    Declaration
    Task<IUserMessage> GetOriginalResponseAsync(RequestOptions options = null)
    Parameters
    Type Name Description
    RequestOptions options

    The request options for this async request.

    Returns
    Type Description
    Task<IUserMessage>

    A IUserMessage that represents the initial response.

    | Improve this Doc View Source

    ModifyOriginalResponseAsync(Action<MessageProperties>, RequestOptions)

    Edits original response for this interaction.

    Declaration
    Task<IUserMessage> ModifyOriginalResponseAsync(Action<MessageProperties> func, RequestOptions options = null)
    Parameters
    Type Name Description
    Action<MessageProperties> func

    A delegate containing the properties to modify the message with.

    RequestOptions options

    The request options for this async request.

    Returns
    Type Description
    Task<IUserMessage>

    A task that represents an asynchronous modification operation. The task result contains the updated message.

    | Improve this Doc View Source

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

    Responds to an Interaction with type ChannelMessageWithSource.

    Declaration
    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

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

    | Improve this Doc View Source

    RespondWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Responds to this interaction with a file attachment.

    Declaration
    Task RespondWithFileAsync(FileAttachment attachment, 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
    FileAttachment attachment

    The attachment containing the file and 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

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

    | Improve this Doc View Source

    RespondWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)

    Responds to this interaction with a file attachment.

    Declaration
    Task RespondWithFileAsync(Stream fileStream, string fileName, 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
    Stream fileStream

    The file to upload.

    String fileName

    The file name of the attachment.

    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

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

    | Improve this Doc View Source

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

    Responds to this interaction with a file attachment.

    Declaration
    Task RespondWithFileAsync(string filePath, string fileName = null, 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 filePath

    The file to upload.

    String fileName

    The file name of the attachment.

    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

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

    | Improve this Doc View Source

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

    Responds to this interaction with a collection of file attachments.

    Declaration
    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

    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

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

    | Improve this Doc View Source

    RespondWithModalAsync(Modal, RequestOptions)

    Responds to the interaction with a modal.

    Declaration
    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.

    Extension Methods

    IDiscordInteractionExtentions.RespondWithModalAsync<T>(IDiscordInteraction, String, RequestOptions, Action<ModalBuilder>)
    IDiscordInteractionExtentions.RespondWithModalAsync<T>(IDiscordInteraction, String, InteractionService, RequestOptions, Action<ModalBuilder>)
    IDiscordInteractionExtentions.RespondWithModalAsync<T>(IDiscordInteraction, String, T, RequestOptions, Action<ModalBuilder>)

    Theme

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