NadekoBot/NadekoBot.Core/Services/Database/Models/GuildConfig.cs

276 lines
8.7 KiB
C#
Raw Normal View History

2017-03-10 22:06:22 +00:00
using System;
using System.Collections.Generic;
2016-08-24 17:04:24 +00:00
namespace NadekoBot.Core.Services.Database.Models
2016-08-24 17:04:24 +00:00
{
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; }
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; }
public string ChannelByeMessageText { get; set; } = "%user% has left!";
2016-08-25 01:19:06 +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
public HashSet<FollowedStream> FollowedStreams { get; set; } = new HashSet<FollowedStream>();
2016-09-08 20:27:39 +00:00
//currencyGeneration
public HashSet<GCChannelId> GenerateCurrencyChannelIds { get; set; } = new HashSet<GCChannelId>();
//permissions
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;
public string PermissionRole { get; set; } = "Nadeko";
2016-10-03 17:21:05 +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; }
public HashSet<FilterChannelId> FilterInvitesChannelIds { get; set; } = new HashSet<FilterChannelId>();
2016-10-03 17:21:05 +00:00
2017-10-17 12:37:57 +00:00
//public bool FilterLinks { get; set; }
//public HashSet<FilterLinksChannelId> FilterLinksChannels { get; set; } = new HashSet<FilterLinksChannelId>();
2017-10-17 05:03:56 +00:00
2016-10-03 17:21:05 +00:00
public bool FilterWords { get; set; }
public HashSet<FilteredWord> FilteredWords { get; set; } = new HashSet<FilteredWord>();
public HashSet<FilterChannelId> FilterWordsChannelIds { get; set; } = new HashSet<FilterChannelId>();
public HashSet<MutedUserId> MutedUsers { get; set; } = new HashSet<MutedUserId>();
public string MuteRoleName { get; set; }
2016-11-07 21:50:00 +00:00
public bool CleverbotEnabled { get; set; }
public HashSet<GuildRepeater> GuildRepeaters { get; set; } = new HashSet<GuildRepeater>();
public AntiRaidSetting AntiRaidSetting { get; set; }
public AntiSpamSetting AntiSpamSetting { get; set; }
public string Locale { get; set; } = null;
public string TimeZoneId { get; set; } = null;
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; }
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; }
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;
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>();
public bool AutoDcFromVc { get; set; }
2017-08-22 03:48:45 +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
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; }
}
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
public class FilterChannelId : DbEntity
2016-10-03 17:21:05 +00:00
{
public ulong ChannelId { get; set; }
}
2017-10-17 05:03:56 +00: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();
}
}
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
}
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();
}
2016-08-24 17:04:24 +00:00
}