2017-05-27 23:51:22 +00:00
|
|
|
|
using System.Collections.Generic;
|
2017-10-13 04:14:54 +00:00
|
|
|
|
namespace NadekoBot.Core.Services.Database.Models
|
2017-01-10 19:40:52 +00:00
|
|
|
|
{
|
|
|
|
|
public class AntiRaidSetting : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public int GuildConfigId { get; set; }
|
|
|
|
|
public GuildConfig GuildConfig { get; set; }
|
|
|
|
|
|
|
|
|
|
public int UserThreshold { get; set; }
|
|
|
|
|
public int Seconds { get; set; }
|
|
|
|
|
public PunishmentAction Action { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AntiSpamSetting : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public int GuildConfigId { get; set; }
|
|
|
|
|
public GuildConfig GuildConfig { get; set; }
|
|
|
|
|
|
|
|
|
|
public PunishmentAction Action { get; set; }
|
|
|
|
|
public int MessageThreshold { get; set; } = 3;
|
2017-08-15 23:12:18 +00:00
|
|
|
|
public int MuteTime { get; set; } = 0;
|
2017-01-10 19:40:52 +00:00
|
|
|
|
public HashSet<AntiSpamIgnore> IgnoredChannels { get; set; } = new HashSet<AntiSpamIgnore>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum PunishmentAction
|
|
|
|
|
{
|
|
|
|
|
Mute,
|
|
|
|
|
Kick,
|
|
|
|
|
Ban,
|
2017-04-01 09:15:37 +00:00
|
|
|
|
Softban
|
2017-01-10 19:40:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class AntiSpamIgnore : DbEntity
|
|
|
|
|
{
|
|
|
|
|
public ulong ChannelId { get; set; }
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode() => ChannelId.GetHashCode();
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
var inst = obj as AntiSpamIgnore;
|
|
|
|
|
|
|
|
|
|
if (inst == null)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return inst.ChannelId == ChannelId;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|