Fixed plaintext-only embeds. closes #360

This commit is contained in:
Kwoth
2022-06-14 14:26:59 +02:00
parent 050eaa48eb
commit 6bec67006c
6 changed files with 12 additions and 9 deletions

View File

@@ -21,7 +21,7 @@ public static class Extensions
{
SmartEmbedText set => msg.ModifyAsync(x =>
{
x.Embed = set.GetEmbed().Build();
x.Embed = set.IsValid ? set.GetEmbed().Build() : null;
x.Content = set.PlainText?.SanitizeMentions() ?? "";
}),
SmartEmbedTextArray set => msg.ModifyAsync(x =>

View File

@@ -54,7 +54,7 @@ public static class MessageChannelExtensions
=> text switch
{
SmartEmbedText set => channel.SendAsync(set.PlainText,
set.GetEmbed().Build(),
set.IsValid ? set.GetEmbed().Build() : null,
sanitizeAll: sanitizeAll),
SmartPlainText st => channel.SendAsync(st.Text,
default(Embed),

View File

@@ -36,7 +36,7 @@ public static class SocketMessageComponentExtensions
=> text switch
{
SmartEmbedText set => smc.RespondAsync(set.PlainText,
set.GetEmbed().Build(),
set.IsValid ? set.GetEmbed().Build() : null,
sanitizeAll: sanitizeAll,
ephemeral: ephemeral),
SmartPlainText st => smc.RespondAsync(st.Text,