|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
using DiscordChatExporter.Core.Discord.Data.Common;
|
|
|
|
@ -21,8 +20,7 @@ public partial record Member(
|
|
|
|
|
|
|
|
|
|
public partial record Member
|
|
|
|
|
{
|
|
|
|
|
public static Member CreateFallback(User user) =>
|
|
|
|
|
new(user, null, null, Array.Empty<Snowflake>());
|
|
|
|
|
public static Member CreateFallback(User user) => new(user, null, null, []);
|
|
|
|
|
|
|
|
|
|
public static Member Parse(JsonElement json, Snowflake? guildId = null)
|
|
|
|
|
{
|
|
|
|
@ -34,7 +32,7 @@ public partial record Member
|
|
|
|
|
?.EnumerateArray()
|
|
|
|
|
.Select(j => j.GetNonWhiteSpaceString())
|
|
|
|
|
.Select(Snowflake.Parse)
|
|
|
|
|
.ToArray() ?? Array.Empty<Snowflake>();
|
|
|
|
|
.ToArray() ?? [];
|
|
|
|
|
|
|
|
|
|
var avatarUrl = guildId is not null
|
|
|
|
|
? json.GetPropertyOrNull("avatar")
|
|
|
|
|