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

@@ -23,6 +23,11 @@ public static class Extensions
x.Embed = set.GetEmbed().Build();
x.Content = set.PlainText?.SanitizeMentions() ?? "";
}),
SmartEmbedTextArray set => msg.ModifyAsync(x =>
{
x.Embeds = set.GetEmbedBuilders().Map(eb => eb.Build());
x.Content = set.PlainText?.SanitizeMentions() ?? "";
}),
SmartPlainText spt => msg.ModifyAsync(x =>
{
x.Content = spt.Text.SanitizeMentions();
@@ -116,8 +121,7 @@ public static class Extensions
args = strings.GetCommandStrings(cmd.Summary, culture).Args;
}
return Array.ConvertAll(args,
arg => GetFullUsage(cmd.Name, arg, prefix));
return args.Map(arg => GetFullUsage(cmd.Name, arg, prefix));
}
private static string GetFullUsage(string commandName, string args, string prefix)