Browse Source

Fix ModifyAsync (#2023)

* Fix issue with Argument cannot be blank when modifying flags

* Make uniform with existing code
tags/3.2.0
Brendan McShane GitHub 3 years ago
parent
commit
e3eb0a9522
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs

+ 3
- 1
src/Discord.Net.Rest/Entities/Messages/MessageHelper.cs View File

@@ -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)


Loading…
Cancel
Save