using System; using System.Collections.Generic; namespace NadekoBot.Core.Services.Database.Models { public class GuildConfig : DbEntity { public ulong GuildId { get; set; } public string Prefix { get; set; } = null; public bool DeleteMessageOnCommand { get; set; } public ulong AutoAssignRoleId { get; set; } //greet stuff public bool AutoDeleteGreetMessages { get; set; } //unused public bool AutoDeleteByeMessages { get; set; } // unused public int AutoDeleteGreetMessagesTimer { get; set; } = 30; public int AutoDeleteByeMessagesTimer { get; set; } = 30; public ulong GreetMessageChannelId { get; set; } public ulong ByeMessageChannelId { get; set; } public bool SendDmGreetMessage { get; set; } public string DmGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; public bool SendChannelGreetMessage { get; set; } public string ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; public bool SendChannelByeMessage { get; set; } public string ChannelByeMessageText { get; set; } = "%user% has left!"; public LogSetting LogSetting { get; set; } = new LogSetting(); //self assignable roles public bool ExclusiveSelfAssignedRoles { get; set; } public bool AutoDeleteSelfAssignedRoleMessages { get; set; } public float DefaultMusicVolume { get; set; } = 1.0f; public bool VoicePlusTextEnabled { get; set; } //stream notifications public HashSet FollowedStreams { get; set; } = new HashSet(); //currencyGeneration public HashSet GenerateCurrencyChannelIds { get; set; } = new HashSet(); //permissions public Permission RootPermission { get; set; } = null; public List Permissions { get; set; } public bool VerbosePermissions { get; set; } = true; public string PermissionRole { get; set; } = "Nadeko"; public HashSet CommandCooldowns { get; set; } = new HashSet(); //filtering public bool FilterInvites { get; set; } public HashSet FilterInvitesChannelIds { get; set; } = new HashSet(); //public bool FilterLinks { get; set; } //public HashSet FilterLinksChannels { get; set; } = new HashSet(); public bool FilterWords { get; set; } public HashSet FilteredWords { get; set; } = new HashSet(); public HashSet FilterWordsChannelIds { get; set; } = new HashSet(); public HashSet MutedUsers { get; set; } = new HashSet(); public string MuteRoleName { get; set; } public bool CleverbotEnabled { get; set; } public HashSet GuildRepeaters { get; set; } = new HashSet(); public AntiRaidSetting AntiRaidSetting { get; set; } public AntiSpamSetting AntiSpamSetting { get; set; } public string Locale { get; set; } = null; public string TimeZoneId { get; set; } = null; public HashSet UnmuteTimers { get; set; } = new HashSet(); public HashSet VcRoleInfos { get; set; } public HashSet CommandAliases { get; set; } = new HashSet(); public List WarnPunishments { get; set; } = new List(); public bool WarningsInitialized { get; set; } public HashSet SlowmodeIgnoredUsers { get; set; } public HashSet SlowmodeIgnoredRoles { get; set; } public HashSet NsfwBlacklistedTags { get; set; } = new HashSet(); public List ShopEntries { get; set; } public ulong? GameVoiceChannel { get; set; } = null; public bool VerboseErrors { get; set; } = false; public StreamRoleSettings StreamRole { get; set; } public XpSettings XpSettings { get; set; } public List FeedSubs { get; set; } = new List(); public bool AutoDcFromVc { get; set; } public MusicSettings MusicSettings { get; set; } = new MusicSettings(); } public class NsfwBlacklitedTag : DbEntity { public string Tag { get; set; } public override int GetHashCode() { return Tag.GetHashCode(); } public override bool Equals(object obj) { return obj is NsfwBlacklitedTag x ? x.Tag == Tag : false; } } public class SlowmodeIgnoredUser : DbEntity { public ulong UserId { get; set; } // override object.Equals public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return false; } return ((SlowmodeIgnoredUser)obj).UserId == UserId; } // override object.GetHashCode public override int GetHashCode() { return UserId.GetHashCode(); } } public class SlowmodeIgnoredRole : DbEntity { public ulong RoleId { get; set; } // override object.Equals public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return false; } return ((SlowmodeIgnoredRole)obj).RoleId == RoleId; } // override object.GetHashCode public override int GetHashCode() { return RoleId.GetHashCode(); } } public class WarningPunishment : DbEntity { public int Count { get; set; } public PunishmentAction Punishment { get; set; } public int Time { get; set; } } public class CommandAlias : DbEntity { public string Trigger { get; set; } public string Mapping { get; set; } //// override object.Equals //public override bool Equals(object obj) //{ // if (obj == null || GetType() != obj.GetType()) // { // return false; // } // return ((CommandAlias)obj).Trigger.Trim().ToLowerInvariant() == Trigger.Trim().ToLowerInvariant(); //} //// override object.GetHashCode //public override int GetHashCode() //{ // return Trigger.Trim().ToLowerInvariant().GetHashCode(); //} } public class VcRoleInfo : DbEntity { public ulong VoiceChannelId { get; set; } public ulong RoleId { get; set; } } public class UnmuteTimer : DbEntity { public ulong UserId { get; set; } public DateTime UnmuteAt { get; set; } public override int GetHashCode() => UserId.GetHashCode(); public override bool Equals(object obj) { var ut = obj as UnmuteTimer; if (ut == null) return false; return ut.UserId == UserId; } } public class FilterChannelId : DbEntity { public ulong ChannelId { get; set; } } public class FilterLinksChannelId : DbEntity { public ulong ChannelId { get; set; } public override bool Equals(object obj) { return obj is FilterLinksChannelId f ? f.ChannelId == ChannelId : false; } public override int GetHashCode() { return ChannelId.GetHashCode(); } } public class FilteredWord : DbEntity { public string Word { get; set; } } public class MutedUserId : DbEntity { public ulong UserId { get; set; } public override int GetHashCode() { return UserId.GetHashCode(); } public override bool Equals(object obj) { var mui = obj as MutedUserId; if (mui == null) return false; return mui.UserId == this.UserId; } } public class GCChannelId : DbEntity { public ulong ChannelId { get; set; } public override bool Equals(object obj) { var gc = obj as GCChannelId; if (gc == null) return false; return gc.ChannelId == this.ChannelId; } public override int GetHashCode() => this.ChannelId.GetHashCode(); } }