@@ -340,9 +340,10 @@ namespace Discord.Rest | |||||
var embeds = args.Embeds; | var embeds = args.Embeds; | ||||
bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(message.Content); | bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(message.Content); | ||||
bool hasEmbeds = (embed.IsSpecified && embed.Value != null) || (embeds.IsSpecified && embeds.Value?.Length > 0) || message.Embeds.Any(); | |||||
bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0 || message.Embeds.Any(); | |||||
bool hasComponents = args.Components.IsSpecified && args.Components.Value != null; | |||||
if (!hasText && !hasEmbeds) | |||||
if (!hasComponents && !hasText && !hasEmbeds) | |||||
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | ||||
var apiEmbeds = embed.IsSpecified || embeds.IsSpecified ? new List<API.Embed>() : null; | var apiEmbeds = embed.IsSpecified || embeds.IsSpecified ? new List<API.Embed>() : null; | ||||
@@ -383,9 +384,10 @@ namespace Discord.Rest | |||||
var embeds = args.Embeds; | var embeds = args.Embeds; | ||||
bool hasText = !string.IsNullOrEmpty(args.Content.GetValueOrDefault()); | bool hasText = !string.IsNullOrEmpty(args.Content.GetValueOrDefault()); | ||||
bool hasEmbeds = (embed.IsSpecified && embed.Value != null) || (embeds.IsSpecified && embeds.Value?.Length > 0); | |||||
bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0; | |||||
bool hasComponents = args.Components.IsSpecified && args.Components.Value != null; | |||||
if (!hasText && !hasEmbeds) | |||||
if (!hasComponents && !hasText && !hasEmbeds) | |||||
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | ||||
var apiEmbeds = embed.IsSpecified || embeds.IsSpecified ? new List<API.Embed>() : null; | var apiEmbeds = embed.IsSpecified || embeds.IsSpecified ? new List<API.Embed>() : null; | ||||
@@ -38,7 +38,7 @@ namespace Discord.Rest | |||||
var embeds = args.Embeds; | var embeds = args.Embeds; | ||||
bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(msg.Content); | bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(msg.Content); | ||||
bool hasEmbeds = (embed.IsSpecified && embed.Value != null) || (embeds.IsSpecified && embeds.Value?.Length > 0) || msg.Embeds.Any(); | |||||
bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0 || msg.Embeds.Any(); | |||||
if (!hasText && !hasEmbeds) | if (!hasText && !hasEmbeds) | ||||
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | ||||
@@ -101,9 +101,10 @@ namespace Discord.Rest | |||||
var embeds = args.Embeds; | var embeds = args.Embeds; | ||||
bool hasText = args.Content.IsSpecified && string.IsNullOrEmpty(args.Content.Value); | bool hasText = args.Content.IsSpecified && string.IsNullOrEmpty(args.Content.Value); | ||||
bool hasEmbeds = (embed.IsSpecified && embed.Value != null) || (embeds.IsSpecified && embeds.Value?.Length > 0); | |||||
bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0; | |||||
bool hasComponents = args.Components.IsSpecified && args.Components.Value != null; | |||||
if (!hasText && !hasEmbeds) | |||||
if (!hasComponents && !hasText && !hasEmbeds) | |||||
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | ||||
if (args.AllowedMentions.IsSpecified) | if (args.AllowedMentions.IsSpecified) | ||||
@@ -150,7 +150,7 @@ namespace Discord.WebSocket | |||||
var embeds = args.Embeds; | var embeds = args.Embeds; | ||||
bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(Message.Content); | bool hasText = args.Content.IsSpecified ? !string.IsNullOrEmpty(args.Content.Value) : !string.IsNullOrEmpty(Message.Content); | ||||
bool hasEmbeds = (embed.IsSpecified && embed.Value != null) || (embeds.IsSpecified && embeds.Value?.Length > 0) || Message.Embeds.Any(); | |||||
bool hasEmbeds = embed.IsSpecified && embed.Value != null || embeds.IsSpecified && embeds.Value?.Length > 0 || Message.Embeds.Any(); | |||||
if (!hasText && !hasEmbeds) | if (!hasText && !hasEmbeds) | ||||
Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | Preconditions.NotNullOrEmpty(args.Content.IsSpecified ? args.Content.Value : string.Empty, nameof(args.Content)); | ||||