Table of Contents

Class DiscordInteraction

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

Represents an interaction that was invoked.

public class DiscordInteraction : SnowflakeObject
Inheritance
DiscordInteraction
Derived
Inherited Members
Extension Methods

Properties

AppPermissions

The permissions allowed to the application for the given context.

ApplicationId

Gets the ID of the application that created this interaction.

AuthorizingIntegrationOwners

Gets the interactions that authorized the interaction.

This dictionary contains the following:

  • If the interaction is installed to a user, a key of UserInstall and a value of the user's ID.
  • If the interaction is installed to a guild, a key of GuildInstall and a value of the guild's ID.
    • IF the interaction was sent from a guild context, the above holds true, otherwise the ID is 0.
Channel

Gets the channel that invoked this interaction.

ChannelId

Gets the Id of the channel that invoked this interaction.

Context

Represents the context in which the interaction was executed in

Data

Gets the command data for this interaction.

Guild

Gets the guild that invoked this interaction. Returns null if interaction was triggered in a private channel.

GuildId

Gets the Id of the guild that invoked this interaction. Returns null if interaction was triggered in a private channel.

GuildLocale

Gets the guild's preferred locale, if invoked in a guild.

Locale

Gets the locale of the user that invoked this interaction.

Message

The message this interaction was created with, if any.

ResponseState

Gets the response state of the interaction.

Token

Gets the continuation token for responding to this interaction.

Type

Gets the type of interaction invoked.

User

Gets the user that invoked this interaction.

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

Version

Gets the version number for this interaction type.

Methods

CreateFollowupMessageAsync(DiscordFollowupMessageBuilder)

Creates a follow up message to this interaction.

CreateResponseAsync(DiscordInteractionResponseType, DiscordInteractionResponseBuilder)

Creates a response to this interaction.

DeferAsync(bool)

Creates a deferred response to this interaction.

DeleteFollowupMessageAsync(ulong)

Deletes a follow up message.

DeleteOriginalResponseAsync()

Deletes the original interaction response.

EditFollowupMessageAsync(ulong, DiscordWebhookBuilder, IEnumerable<DiscordAttachment>)

Edits a follow up message.

EditOriginalResponseAsync(DiscordWebhookBuilder, IEnumerable<DiscordAttachment>)

Edits the original interaction response.

GetFollowupMessageAsync(ulong)

Gets a follow up message.

GetOriginalResponseAsync()

Gets the original interaction response.