diff --git a/src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs b/src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs
index 3979e8835..5c409e837 100644
--- a/src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs
@@ -26,9 +26,9 @@ namespace Discord
InteractionType Type { get; }
///
- /// The command data payload.
+ /// Represents the data sent within this interaction.
///
- IApplicationCommandInteractionData? Data { get; }
+ object Data { get; }
///
/// A continuation token for responding to the interaction.
diff --git a/src/Discord.Net.Core/Entities/Interactions/InteractionResponseType.cs b/src/Discord.Net.Core/Entities/Interactions/InteractionResponseType.cs
index eca4fdff6..1b103f491 100644
--- a/src/Discord.Net.Core/Entities/Interactions/InteractionResponseType.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/InteractionResponseType.cs
@@ -42,6 +42,16 @@ namespace Discord
///
/// ACK an interaction and edit a response later, the user sees a loading state.
///
- DeferredChannelMessageWithSource = 5
+ DeferredChannelMessageWithSource = 5,
+
+ ///
+ /// for components: ACK an interaction and edit the original message later; the user does not see a loading state
+ ///
+ DeferredUpdateMessage = 6,
+
+ ///
+ /// for components: edit the message the component was attached to
+ ///
+ UpdateMessage = 7
}
}
diff --git a/src/Discord.Net.Core/Entities/Interactions/InteractionType.cs b/src/Discord.Net.Core/Entities/Interactions/InteractionType.cs
index f95960586..4da39b58e 100644
--- a/src/Discord.Net.Core/Entities/Interactions/InteractionType.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/InteractionType.cs
@@ -17,8 +17,13 @@ namespace Discord
Ping = 1,
///
- /// An sent from discord.
+ /// A sent from discord.
///
- ApplicationCommand = 2
+ ApplicationCommand = 2,
+
+ ///
+ /// A sent from discord.
+ ///
+ MessageComponent = 3,
}
}
diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs
index 6fd74a6f9..7151cc5af 100644
--- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ActionRowComponent.cs
@@ -1,3 +1,4 @@
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -8,8 +9,10 @@ namespace Discord
{
public class ActionRowComponent : IMessageComponent
{
+ [JsonProperty("type")]
public ComponentType Type { get; } = ComponentType.ActionRow;
+ [JsonProperty("components")]
public IReadOnlyCollection Components { get; internal set; }
internal ActionRowComponent() { }
diff --git a/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs b/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs
index 514f45a62..2e2b98f98 100644
--- a/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs
+++ b/src/Discord.Net.Core/Entities/Interactions/Message Components/ButtonComponent.cs
@@ -1,3 +1,4 @@
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -8,18 +9,25 @@ namespace Discord
{
public class ButtonComponent : IMessageComponent
{
+ [JsonProperty("type")]
public ComponentType Type { get; } = ComponentType.Button;
+ [JsonProperty("style")]
public ButtonStyle Style { get; }
+ [JsonProperty("label")]
public string Label { get; }
+ [JsonProperty("emoji")]
public IEmote Emote { get; }
+ [JsonProperty("custom_id")]
public string CustomId { get; }
+ [JsonProperty("url")]
public string Url { get; }
+ [JsonProperty("disabled")]
public bool Disabled { get; }
internal ButtonComponent(ButtonStyle style, string label, IEmote emote, string customId, string url, bool disabled)
diff --git a/src/Discord.Net.Rest/API/Common/InteractionApplicationCommandCallbackData.cs b/src/Discord.Net.Rest/API/Common/InteractionApplicationCommandCallbackData.cs
index 24da5bf7e..f5ce75250 100644
--- a/src/Discord.Net.Rest/API/Common/InteractionApplicationCommandCallbackData.cs
+++ b/src/Discord.Net.Rest/API/Common/InteractionApplicationCommandCallbackData.cs
@@ -25,6 +25,9 @@ namespace Discord.API
[JsonProperty("flags")]
public Optional Flags { get; set; }
+ [JsonProperty("components")]
+ public Optional Components { get; set; }
+
public InteractionApplicationCommandCallbackData() { }
public InteractionApplicationCommandCallbackData(string text)
{
diff --git a/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs b/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs
new file mode 100644
index 000000000..cdb4e7d5c
--- /dev/null
+++ b/src/Discord.Net.Rest/API/Common/MessageComponentInteractionData.cs
@@ -0,0 +1,18 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Discord.API
+{
+ internal class MessageComponentInteractionData
+ {
+ [JsonProperty("custom_id")]
+ public string CustomId { get; set; }
+
+ [JsonProperty("component_type")]
+ public ComponentType ComponentType { get; set; }
+ }
+}
diff --git a/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs b/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs
index 3e201d8eb..c668ee484 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateWebhookMessageParams.cs
@@ -30,6 +30,9 @@ namespace Discord.API.Rest
[JsonProperty("flags")]
public Optional Flags { get; set; }
+ [JsonProperty("components")]
+ public Optional Components { get; set; }
+
public CreateWebhookMessageParams(string content)
{
Content = content;
diff --git a/src/Discord.Net.WebSocket/API/Gateway/InteractionCreated.cs b/src/Discord.Net.WebSocket/API/Gateway/InteractionCreated.cs
index 8fb0cbd58..8c451a552 100644
--- a/src/Discord.Net.WebSocket/API/Gateway/InteractionCreated.cs
+++ b/src/Discord.Net.WebSocket/API/Gateway/InteractionCreated.cs
@@ -17,7 +17,7 @@ namespace Discord.API.Gateway
public InteractionType Type { get; set; }
[JsonProperty("data")]
- public Optional Data { get; set; }
+ public Optional