From e3eb0a95222520e4acba4a61ca3ead05e921fdb9 Mon Sep 17 00:00:00 2001 From: Brendan McShane Date: Fri, 7 Jan 2022 21:40:08 -0500 Subject: [PATCH] Fix ModifyAsync (#2023) * Fix issue with Argument cannot be blank when modifying flags * Make uniform with existing code --- src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs b/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs index 309500c96..cd2a34f11 100644 --- a/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs +++ b/src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs @@ -42,8 +42,10 @@ namespace Discord.Rest bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0; bool hasComponents = args.Components.IsSpecified && args.Components.Value != null; bool hasAttachments = args.Attachments.IsSpecified; + bool hasFlags = args.Flags.IsSpecified; - if (!hasComponents && !hasText && !hasEmbeds && !hasAttachments) + // No content needed if modifying flags + if ((!hasComponents && !hasText && !hasEmbeds && !hasAttachments) && !hasFlags) Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); if (args.AllowedMentions.IsSpecified)