Browse Source

Fix #355 and make UpdateAsync return a RestInteractionResponse

pull/1966/head
quin lynch 3 years ago
parent
commit
25074fa513
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Extensions/EntityExtensions.cs
  2. +2
    -2
      src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs

+ 1
- 1
src/Discord.Net.Rest/Extensions/EntityExtensions.cs View File

@@ -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<string>.Unspecified : data.Content,
Embeds = data.Embeds,
AllowedMentions = data.AllowedMentions,
Components = data.Components,


+ 2
- 2
src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponent.cs View File

@@ -155,7 +155,7 @@ namespace Discord.WebSocket
/// <param name="func">A delegate containing the properties to modify the message with.</param>
/// <param name="options">The request options for this <see langword="async"/> request.</param>
/// <returns>A task that represents the asynchronous operation of updating the message.</returns>
public async Task UpdateAsync(Action<MessageProperties> func, RequestOptions options = null)
public async Task<RestInteractionMessage> UpdateAsync(Action<MessageProperties> 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)
{


Loading…
Cancel
Save