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