Search Results for

    Show / Hide Table of Contents

    Class DiscordInteraction

    Represents an interaction that was invoked.

    Inheritance
    System.Object
    SnowflakeObject
    DiscordInteraction
    Inherited Members
    SnowflakeObject.Id
    SnowflakeObject.CreationTimestamp
    Namespace: DisCatSharp.Entities
    Assembly: DisCatSharp.dll
    Syntax
    public sealed class DiscordInteraction : SnowflakeObject

    Properties

    | Improve this Doc View Source

    ApplicationId

    Gets the ID of the application that created this interaction.

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

    Channel

    Gets the channel that invoked this interaction.

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

    ChannelId

    Gets the Id of the channel that invoked this interaction.

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

    Data

    Gets the command data for this interaction.

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

    Guild

    Gets the guild that invoked this interaction.

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

    GuildId

    Gets the Id of the guild that invoked this interaction.

    Declaration
    public ulong? GuildId { get; }
    Property Value
    Type Description
    System.Nullable<System.UInt64>
    | Improve this Doc View Source

    GuildLocale

    Gets the guild locale if applicable.

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

    Locale

    Gets the invoking user locale.

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

    Token

    Gets the continuation token for responding to this interaction.

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

    Type

    Gets the type of interaction invoked.

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

    User

    Gets the user that invoked this interaction.

    This can be cast to a DiscordMember if created in a guild.

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

    Version

    Gets the version number for this interaction type.

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

    Methods

    | Improve this Doc View Source

    CreateFollowupMessageAsync(DiscordFollowupMessageBuilder)

    Creates a follow up message to this interaction.

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

    The webhook builder.

    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMessage>

    The created DiscordMessage.

    | Improve this Doc View Source

    CreateInteractionModalResponseAsync(DiscordInteractionModalBuilder)

    Creates a modal response to this interaction.

    Declaration
    public Task CreateInteractionModalResponseAsync(DiscordInteractionModalBuilder builder)
    Parameters
    Type Name Description
    DiscordInteractionModalBuilder builder

    The data to send.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    CreateResponseAsync(InteractionResponseType, DiscordInteractionResponseBuilder)

    Creates a response to this interaction.

    Declaration
    public Task CreateResponseAsync(InteractionResponseType type, DiscordInteractionResponseBuilder builder = null)
    Parameters
    Type Name Description
    InteractionResponseType type

    The type of the response.

    DiscordInteractionResponseBuilder builder

    The data, if any, to send.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    DeleteFollowupMessageAsync(UInt64)

    Deletes a follow up message.

    Declaration
    public Task DeleteFollowupMessageAsync(ulong messageId)
    Parameters
    Type Name Description
    System.UInt64 messageId

    The id of the follow up message.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    DeleteOriginalResponseAsync()

    Deletes the original interaction response.

    Declaration
    public Task DeleteOriginalResponseAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    EditFollowupMessageAsync(UInt64, DiscordWebhookBuilder)

    Edits a follow up message.

    Declaration
    public async Task<DiscordMessage> EditFollowupMessageAsync(ulong messageId, DiscordWebhookBuilder builder)
    Parameters
    Type Name Description
    System.UInt64 messageId

    The id of the follow up message.

    DiscordWebhookBuilder builder

    The webhook builder.

    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMessage>

    The edited DiscordMessage.

    | Improve this Doc View Source

    EditOriginalResponseAsync(DiscordWebhookBuilder)

    Edits the original interaction response.

    Declaration
    public async Task<DiscordMessage> EditOriginalResponseAsync(DiscordWebhookBuilder builder)
    Parameters
    Type Name Description
    DiscordWebhookBuilder builder

    The webhook builder.

    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMessage>

    The edited DiscordMessage.

    | Improve this Doc View Source

    GetFollowupMessageAsync(UInt64)

    Gets a follow up message.

    Declaration
    public Task<DiscordMessage> GetFollowupMessageAsync(ulong messageId)
    Parameters
    Type Name Description
    System.UInt64 messageId

    The id of the follow up message.

    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMessage>
    | Improve this Doc View Source

    GetOriginalResponseAsync()

    Gets the original interaction response.

    Declaration
    public Task<DiscordMessage> GetOriginalResponseAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<DiscordMessage>

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

    Extension Methods

    InteractionExtensions.SendPaginatedResponseAsync(DiscordInteraction, Boolean, DiscordUser, IEnumerable<Page>, PaginationButtons, Nullable<PaginationBehaviour>, Nullable<ButtonPaginationBehavior>, CancellationToken)
    InteractionExtensions.CreatePaginatedModalResponseAsync(DiscordInteraction, IReadOnlyList<ModalPage>, Nullable<TimeSpan>)
    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems