Fixed a nullref message when the bot is loading medusae. Added support for multiple embeds in features which support custom embeds in the form of

{plainText:text-here, embeds: [embedObject, embedObject, embedObject]}
This commit is contained in:
Kwoth
2022-04-17 09:58:30 +02:00
parent 29d94640af
commit 18400dc53a
10 changed files with 104 additions and 23 deletions

View File

@@ -36,9 +36,17 @@ public class Replacer
{
SmartEmbedText embedData => Replace(embedData),
SmartPlainText plain => Replace(plain),
SmartEmbedTextArray arr => Replace(arr),
_ => throw new ArgumentOutOfRangeException(nameof(data), "Unsupported argument type")
};
public SmartEmbedTextArray Replace(SmartEmbedTextArray embedArr)
=> new()
{
Embeds = embedArr.Embeds.Map(Replace),
PlainText = Replace(embedArr.PlainText)
};
public SmartPlainText Replace(SmartPlainText plainText)
=> Replace(plainText.Text);