From 25074fa513fe56424f998dc5168b1f7c7e40598c Mon Sep 17 00:00:00 2001 From: quin lynch Date: Tue, 7 Dec 2021 23:49:38 -0400 Subject: [PATCH] Fix #355 and make UpdateAsync return a RestInteractionResponse --- src/Discord.Net.Rest/Extensions/EntityExtensions.cs | 2 +- .../Interaction/MessageComponents/SocketMessageComponent.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net.Rest/Extensions/EntityExtensions.cs b/src/Discord.Net.Rest/Extensions/EntityExtensions.cs index bca2e8715..4062cda3d 100644 --- a/src/Discord.Net.Rest/Extensions/EntityExtensions.cs +++ b/src/Discord.Net.Rest/Extensions/EntityExtensions.cs @@ -179,7 +179,7 @@ namespace Discord.Rest var messageModel = new API.Message { IsTextToSpeech = data.TTS, - Content = data.Content, + Content = (data.Content.IsSpecified && data.Content.Value == null) ? Optional.Unspecified : data.Content, Embeds = data.Embeds, AllowedMentions = data.AllowedMentions, Components = data.Components, diff --git a/src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs b/src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs index d5d5f959d..c1f9d3421 100644 --- a/src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs +++ b/src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs @@ -155,7 +155,7 @@ namespace Discord.WebSocket /// A delegate containing the properties to modify the message with. /// The request options for this request. /// A task that represents the asynchronous operation of updating the message. - public async Task UpdateAsync(Action func, RequestOptions options = null) + public async Task UpdateAsync(Action func, RequestOptions options = null) { var args = new MessageProperties(); func(args); @@ -236,7 +236,7 @@ namespace Discord.WebSocket } } - await InteractionHelper.SendInteractionResponseAsync(Discord, response, this, Channel, options).ConfigureAwait(false); + return await InteractionHelper.SendInteractionResponseAsync(Discord, response, this, Channel, options).ConfigureAwait(false); lock (_lock) {