mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-29 10:39:53 +03:00
Remora.Discord part 1 out of ∞
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
02949656bf
commit
201a1ce079
24 changed files with 141 additions and 1588 deletions
|
@ -1,38 +0,0 @@
|
|||
using System.Text.Json.Serialization;
|
||||
using Discord;
|
||||
|
||||
namespace Boyfriend.Data;
|
||||
|
||||
public record MemberData {
|
||||
public DateTimeOffset? BannedUntil;
|
||||
public ulong Id;
|
||||
public bool IsInGuild;
|
||||
public List<DateTimeOffset> JoinedAt;
|
||||
public List<DateTimeOffset> LeftAt;
|
||||
public DateTimeOffset? MutedUntil;
|
||||
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