BirthdayBot/Data/GuildConfig.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2022-03-19 07:00:15 +00:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace BirthdayBot.Data;
[Table("settings")]
public class GuildConfig {
public GuildConfig() {
BlockedUsers = new HashSet<BlocklistEntry>();
UserEntries = new HashSet<UserEntry>();
}
[Key]
2022-11-23 07:19:37 +00:00
public ulong GuildId { get; set; }
2022-03-19 07:00:15 +00:00
[Column("role_id")]
2022-11-23 07:19:37 +00:00
public ulong? BirthdayRole { get; set; }
2022-03-19 07:00:15 +00:00
[Column("channel_announce_id")]
2022-11-23 07:19:37 +00:00
public ulong? AnnouncementChannel { get; set; }
2022-03-19 07:00:15 +00:00
[Column("time_zone")]
public string? GuildTimeZone { get; set; }
2022-11-23 07:19:37 +00:00
2022-03-19 07:00:15 +00:00
public bool Moderated { get; set; }
2022-11-23 07:19:37 +00:00
public ulong? ModeratorRole { get; set; }
2022-03-19 07:00:15 +00:00
public string? AnnounceMessage { get; set; }
2022-11-23 07:19:37 +00:00
2022-03-19 07:00:15 +00:00
public string? AnnounceMessagePl { get; set; }
2022-11-23 07:19:37 +00:00
2022-03-19 07:00:15 +00:00
public bool AnnouncePing { get; set; }
2022-11-23 07:19:37 +00:00
2022-03-19 07:00:15 +00:00
public DateTimeOffset LastSeen { get; set; }
[InverseProperty(nameof(BlocklistEntry.Guild))]
public ICollection<BlocklistEntry> BlockedUsers { get; set; }
[InverseProperty(nameof(UserEntry.Guild))]
public ICollection<UserEntry> UserEntries { get; set; }
/// <summary>
/// Gets if this instance is new and does not (yet) exist in the database.
/// </summary>
[NotMapped]
public bool IsNew { get; set; }
2022-03-19 07:00:15 +00:00
}