2017-03-10 23:06:22 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2016-08-24 19:04:24 +02:00
|
|
|
|
|
2017-10-13 06:14:54 +02:00
|
|
|
|
namespace NadekoBot.Core.Services.Database.Models
|
2016-08-24 19:04:24 +02:00
|
|
|
|
{
|
2016-08-25 01:41:11 +02:00
|
|
|
|
public class GuildConfig : DbEntity
|
2016-08-24 19:04:24 +02:00
|
|
|
|
{
|
|
|
|
|
public ulong GuildId { get; set; }
|
2017-05-30 06:54:59 +02:00
|
|
|
|
|
|
|
|
|
public string Prefix { get; set; } = null;
|
|
|
|
|
|
2016-08-25 00:39:02 +02:00
|
|
|
|
public bool DeleteMessageOnCommand { get; set; }
|
|
|
|
|
public ulong AutoAssignRoleId { get; set; }
|
2016-08-25 03:19:06 +02:00
|
|
|
|
//greet stuff
|
2016-11-22 11:42:26 +01:00
|
|
|
|
public bool AutoDeleteGreetMessages { get; set; } //unused
|
|
|
|
|
public bool AutoDeleteByeMessages { get; set; } // unused
|
2016-08-25 03:19:06 +02:00
|
|
|
|
public int AutoDeleteGreetMessagesTimer { get; set; } = 30;
|
2016-11-22 11:42:26 +01:00
|
|
|
|
public int AutoDeleteByeMessagesTimer { get; set; } = 30;
|
2016-08-25 03:19:06 +02:00
|
|
|
|
|
|
|
|
|
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; }
|
2016-08-25 16:17:21 +02:00
|
|
|
|
public string ChannelByeMessageText { get; set; } = "%user% has left!";
|
2016-08-25 03:19:06 +02:00
|
|
|
|
|
2016-09-05 12:27:58 +02:00
|
|
|
|
public LogSetting LogSetting { get; set; } = new LogSetting();
|
|
|
|
|
|
2016-08-26 19:25:54 +02:00
|
|
|
|
//self assignable roles
|
|
|
|
|
public bool ExclusiveSelfAssignedRoles { get; set; }
|
|
|
|
|
public bool AutoDeleteSelfAssignedRoleMessages { get; set; }
|
2016-08-30 16:43:54 +02:00
|
|
|
|
public float DefaultMusicVolume { get; set; } = 1.0f;
|
|
|
|
|
public bool VoicePlusTextEnabled { get; set; }
|
2016-09-01 02:17:48 +02:00
|
|
|
|
|
|
|
|
|
//stream notifications
|
2016-10-10 06:12:22 +02:00
|
|
|
|
public HashSet<FollowedStream> FollowedStreams { get; set; } = new HashSet<FollowedStream>();
|
2016-09-08 22:27:39 +02:00
|
|
|
|
|
|
|
|
|
//currencyGeneration
|
2016-10-11 05:27:36 +02:00
|
|
|
|
public HashSet<GCChannelId> GenerateCurrencyChannelIds { get; set; } = new HashSet<GCChannelId>();
|
2016-09-20 03:08:28 +02:00
|
|
|
|
|
|
|
|
|
//permissions
|
2017-03-09 00:58:58 +01:00
|
|
|
|
public Permission RootPermission { get; set; } = null;
|
|
|
|
|
public List<Permissionv2> Permissions { get; set; }
|
2016-10-08 20:24:34 +02:00
|
|
|
|
public bool VerbosePermissions { get; set; } = true;
|
2016-09-30 02:40:33 +02:00
|
|
|
|
public string PermissionRole { get; set; } = "Nadeko";
|
2016-10-03 19:21:05 +02:00
|
|
|
|
|
2016-10-08 00:23:41 +02:00
|
|
|
|
public HashSet<CommandCooldown> CommandCooldowns { get; set; } = new HashSet<CommandCooldown>();
|
|
|
|
|
|
2016-10-03 19:21:05 +02:00
|
|
|
|
//filtering
|
|
|
|
|
public bool FilterInvites { get; set; }
|
2016-10-10 06:12:22 +02:00
|
|
|
|
public HashSet<FilterChannelId> FilterInvitesChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
2016-10-03 19:21:05 +02:00
|
|
|
|
|
2017-10-17 14:37:57 +02:00
|
|
|
|
//public bool FilterLinks { get; set; }
|
|
|
|
|
//public HashSet<FilterLinksChannelId> FilterLinksChannels { get; set; } = new HashSet<FilterLinksChannelId>();
|
2017-10-17 07:03:56 +02:00
|
|
|
|
|
2016-10-03 19:21:05 +02:00
|
|
|
|
public bool FilterWords { get; set; }
|
2016-10-10 06:12:22 +02:00
|
|
|
|
public HashSet<FilteredWord> FilteredWords { get; set; } = new HashSet<FilteredWord>();
|
|
|
|
|
public HashSet<FilterChannelId> FilterWordsChannelIds { get; set; } = new HashSet<FilterChannelId>();
|
2016-10-19 08:05:23 +02:00
|
|
|
|
|
2016-12-13 04:49:44 +01:00
|
|
|
|
public HashSet<MutedUserId> MutedUsers { get; set; } = new HashSet<MutedUserId>();
|
|
|
|
|
|
2016-10-19 08:05:23 +02:00
|
|
|
|
public string MuteRoleName { get; set; }
|
2016-11-07 22:50:00 +01:00
|
|
|
|
public bool CleverbotEnabled { get; set; }
|
2017-01-10 13:37:35 +01:00
|
|
|
|
public HashSet<GuildRepeater> GuildRepeaters { get; set; } = new HashSet<GuildRepeater>();
|
2017-01-10 20:37:41 +01:00
|
|
|
|
|
|
|
|
|
public AntiRaidSetting AntiRaidSetting { get; set; }
|
|
|
|
|
public AntiSpamSetting AntiSpamSetting { get; set; }
|
|
|
|
|
|
2017-02-13 13:56:06 +01:00
|
|
|
|
public string Locale { get; set; } = null;
|
|
|
|
|
public string TimeZoneId { get; set; } = null;
|
2017-02-13 10:29:57 +01:00
|
|
|
|
|
2017-03-10 23:06:22 +01:00
|
|
|
|
public HashSet<UnmuteTimer> UnmuteTimers { get; set; } = new HashSet<UnmuteTimer>();
|
2017-03-11 08:00:58 +01:00
|
|
|
|
public HashSet<VcRoleInfo> VcRoleInfos { get; set; }
|
2017-03-20 10:53:04 +01:00
|
|
|
|
public HashSet<CommandAlias> CommandAliases { get; set; } = new HashSet<CommandAlias>();
|
2017-03-30 03:51:54 +02:00
|
|
|
|
public List<WarningPunishment> WarnPunishments { get; set; } = new List<WarningPunishment>();
|
|
|
|
|
public bool WarningsInitialized { get; set; }
|
2017-04-01 21:40:13 +02:00
|
|
|
|
public HashSet<SlowmodeIgnoredUser> SlowmodeIgnoredUsers { get; set; }
|
|
|
|
|
public HashSet<SlowmodeIgnoredRole> SlowmodeIgnoredRoles { get; set; }
|
2017-07-21 03:04:44 +02:00
|
|
|
|
public HashSet<NsfwBlacklitedTag> NsfwBlacklistedTags { get; set; } = new HashSet<NsfwBlacklitedTag>();
|
2017-03-10 23:06:22 +01:00
|
|
|
|
|
2017-04-06 21:00:46 +02:00
|
|
|
|
public List<ShopEntry> ShopEntries { get; set; }
|
2017-04-08 21:03:07 +02:00
|
|
|
|
public ulong? GameVoiceChannel { get; set; } = null;
|
2017-06-12 14:26:14 +02:00
|
|
|
|
public bool VerboseErrors { get; set; } = false;
|
2017-04-06 21:00:46 +02:00
|
|
|
|
|
2017-07-19 10:38:14 +02:00
|
|
|
|
public StreamRoleSettings StreamRole { get; set; }
|
2017-07-14 05:00:30 +02:00
|
|
|
|
|
2017-08-22 05:48:45 +02:00
|
|
|
|
public XpSettings XpSettings { get; set; }
|
2017-09-22 06:59:57 +02:00
|
|
|
|
public List<FeedSub> FeedSubs { get; set; } = new List<FeedSub>();
|
2017-10-22 17:16:11 +02:00
|
|
|
|
public bool AutoDcFromVc { get; set; }
|
2017-08-22 05:48:45 +02:00
|
|
|
|
|
2017-01-10 20:37:41 +01:00
|
|
|
|
//public List<ProtectionIgnoredChannel> ProtectionIgnoredChannels { get; set; } = new List<ProtectionIgnoredChannel>();
|
2016-10-03 19:21:05 +02:00
|
|
|
|
}
|
2017-03-10 23:06:22 +01:00
|
|
|
|
|
2017-07-21 03:04:44 +02:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-01 21:40:13 +02:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-30 03:51:54 +02:00
|
|
|
|
public class WarningPunishment : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public int Count { get; set; }
|
|
|
|
|
public PunishmentAction Punishment { get; set; }
|
|
|
|
|
public int Time { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-20 10:53:04 +01:00
|
|
|
|
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();
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-11 08:00:58 +01:00
|
|
|
|
public class VcRoleInfo : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public ulong VoiceChannelId { get; set; }
|
|
|
|
|
public ulong RoleId { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-10 23:06:22 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-03 19:21:05 +02:00
|
|
|
|
|
2016-12-13 04:49:44 +01:00
|
|
|
|
public class FilterChannelId : DbEntity
|
2016-10-03 19:21:05 +02:00
|
|
|
|
{
|
|
|
|
|
public ulong ChannelId { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-17 07:03:56 +02:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 05:27:36 +02:00
|
|
|
|
public class FilteredWord : DbEntity
|
2016-10-03 19:21:05 +02:00
|
|
|
|
{
|
|
|
|
|
public string Word { get; set; }
|
2016-08-24 19:04:24 +02:00
|
|
|
|
}
|
2016-10-11 05:27:36 +02:00
|
|
|
|
|
2016-12-13 04:49:44 +01:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-11 05:27:36 +02:00
|
|
|
|
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();
|
|
|
|
|
}
|
2016-08-24 19:04:24 +02:00
|
|
|
|
}
|