mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-02 20:19:55 +03:00
Fix more bugs and problems
This commit is contained in:
parent
f1bd54d6f6
commit
7059c7576d
8 changed files with 46 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
|||
using Discord;
|
||||
using System.Text.Json.Serialization;
|
||||
using Discord;
|
||||
|
||||
namespace Boyfriend.Data;
|
||||
|
||||
|
@ -12,12 +13,26 @@ public record MemberData {
|
|||
public List<Reminder> Reminders;
|
||||
public List<ulong> Roles;
|
||||
|
||||
[JsonConstructor]
|
||||
public MemberData(DateTimeOffset? bannedUntil, ulong id, bool isInGuild, List<DateTimeOffset> joinedAt,
|
||||
List<DateTimeOffset> leftAt, DateTimeOffset? mutedUntil, List<Reminder> reminders, List<ulong> 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<DateTimeOffset> { user.JoinedAt!.Value };
|
||||
LeftAt = new List<DateTimeOffset>();
|
||||
Roles = user.RoleIds.ToList();
|
||||
Roles.Remove(user.Guild.Id);
|
||||
Reminders = new List<Reminder>();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue