ModifyAsync Attachments Bug Fix #2236 (#2742)

* ModifyAsync Attatchment Bug Fix

* Resolved UploadWebhookFileParams Bug when passing through null attatchment obj.

* Grammar.

* Update src/Discord.Net.Rest/Entities/Interactions/InteractionHelper.cs

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

---------

Co-authored-by: Misha133 <61027276+Misha-133@users.noreply.github.com>
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
Declan Messer
2023-08-10 14:43:09 +01:00
committed by GitHub
parent 5fb9152db3
commit 0c120796c4

View File

@@ -480,7 +480,9 @@ namespace Discord.Rest
}
else
{
var apiArgs = new UploadWebhookFileParams(args.Attachments.Value.ToArray())
var attachments = args.Attachments.Value?.ToArray() ?? Array.Empty<FileAttachment>();
var apiArgs = new UploadWebhookFileParams(attachments)
{
Content = args.Content,
Embeds = apiEmbeds?.ToArray() ?? Optional<API.Embed[]>.Unspecified,