using System.Text.Json.Serialization; using Discord; namespace Boyfriend.Data; public record MemberData { public DateTimeOffset? BannedUntil; public ulong Id; public bool IsInGuild; public List JoinedAt; public List LeftAt; public DateTimeOffset? MutedUntil; public List Reminders; public List Roles; [JsonConstructor] public MemberData(DateTimeOffset? bannedUntil, ulong id, bool isInGuild, List joinedAt, List leftAt, DateTimeOffset? mutedUntil, List reminders, List roles) { BannedUntil = bannedUntil; Id = id; IsInGuild = isInGuild; JoinedAt = joinedAt; LeftAt = leftAt; MutedUntil = mutedUntil; Reminders = reminders; Roles = roles; } public MemberData(IGuildUser user) { Id = user.Id; IsInGuild = true; JoinedAt = new List { user.JoinedAt!.Value }; LeftAt = new List(); Roles = user.RoleIds.ToList(); Roles.Remove(user.Guild.Id); Reminders = new List(); } }