Don't check message content if an embed is present when modifying

This commit is contained in:
Christopher F
2016-11-26 21:22:35 -05:00
parent 97c3f2bcd1
commit 1be6f77efb

View File

@@ -505,7 +505,8 @@ namespace Discord.API
Preconditions.NotNull(args, nameof(args));
if (args.Content.IsSpecified)
{
Preconditions.NotNullOrEmpty(args.Content, nameof(args.Content));
if (!args.Embed.IsSpecified)
Preconditions.NotNullOrEmpty(args.Content, nameof(args.Content));
if (args.Content.Value.Length > DiscordConfig.MaxMessageSize)
throw new ArgumentOutOfRangeException($"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", nameof(args.Content));
}