mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-09 03:12:29 +00:00
Consistency
This commit is contained in:
@@ -70,7 +70,7 @@ public partial record Embed
|
||||
// with this by merging related embeds at the end of the message parsing process.
|
||||
// https://github.com/Tyrrrz/DiscordChatExporter/issues/695
|
||||
var images =
|
||||
json.GetPropertyOrNull("image")?.Pipe(EmbedImage.Parse).Enumerate().ToArray() ??
|
||||
json.GetPropertyOrNull("image")?.Pipe(EmbedImage.Parse).ToSingletonEnumerable().ToArray() ??
|
||||
Array.Empty<EmbedImage>();
|
||||
|
||||
var video = json.GetPropertyOrNull("video")?.Pipe(EmbedVideo.Parse);
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace DiscordChatExporter.Core.Utils.Extensions;
|
||||
|
||||
public static class CollectionExtensions
|
||||
{
|
||||
public static IEnumerable<T> Enumerate<T>(this T obj)
|
||||
public static IEnumerable<T> ToSingletonEnumerable<T>(this T obj)
|
||||
{
|
||||
yield return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user