fix: Move content check for ModifyMessage (#1503)

good catch, thanks!
This commit is contained in:
Paulo
2020-05-07 10:12:08 -03:00
committed by GitHub
parent 41543a8084
commit f8b2b5627e
2 changed files with 7 additions and 7 deletions

View File

@@ -32,6 +32,11 @@ namespace Discord.Rest
var args = new MessageProperties();
func(args);
bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(msg.Content);
bool hasEmbed = args.Embed.IsSpecified ? args.Embed.Value != null : msg.Embeds.Any();
if (!hasText && !hasEmbed)
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content));
var apiArgs = new API.Rest.ModifyMessageParams
{
Content = args.Content,