Class DiscordInteraction
Represents an interaction that was invoked.
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordInteraction : SnowflakeObject
Properties
| Improve this Doc View SourceApplicationId
Gets the ID of the application that created this interaction.
Declaration
public ulong ApplicationId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Channel
Gets the channel that invoked this interaction.
Declaration
public DiscordChannel Channel { get; }
Property Value
Type | Description |
---|---|
DiscordChannel |
ChannelId
Gets the Id of the channel that invoked this interaction.
Declaration
public ulong ChannelId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Data
Gets the command data for this interaction.
Declaration
public DiscordInteractionData Data { get; }
Property Value
Type | Description |
---|---|
DiscordInteractionData |
Guild
Gets the guild that invoked this interaction.
Declaration
public DiscordGuild Guild { get; }
Property Value
Type | Description |
---|---|
DiscordGuild |
GuildId
Gets the Id of the guild that invoked this interaction.
Declaration
public ulong? GuildId { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.UInt64> |
GuildLocale
Gets the guild locale if applicable.
Declaration
public string GuildLocale { get; }
Property Value
Type | Description |
---|---|
System.String |
Locale
Gets the invoking user locale.
Declaration
public string Locale { get; }
Property Value
Type | Description |
---|---|
System.String |
Token
Gets the continuation token for responding to this interaction.
Declaration
public string Token { get; }
Property Value
Type | Description |
---|---|
System.String |
Type
Gets the type of interaction invoked.
Declaration
public InteractionType Type { get; }
Property Value
Type | Description |
---|---|
InteractionType |
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 |
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 SourceCreateFollowupMessageAsync(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. |
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 |
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 |
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 |
DeleteOriginalResponseAsync()
Deletes the original interaction response.
Declaration
public Task DeleteOriginalResponseAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
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. |
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. |
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> |
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. |