feat: add abuse handling

This commit is contained in:
Iris System 2024-10-23 10:08:25 +13:00
parent 4bf60a47d7
commit 2dfb851246
17 changed files with 405 additions and 16 deletions

View file

@ -0,0 +1,16 @@
using Newtonsoft.Json.Linq;
using SqlKata;
namespace PluralKit.Core;
public class AbuseLogPatch: PatchObject
{
public Partial<string> Description { get; set; }
public Partial<bool> DenyBotUsage { get; set; }
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
.With("description", Description)
.With("deny_bot_usage", DenyBotUsage)
);
}

View file

@ -8,10 +8,12 @@ public class AccountPatch: PatchObject
{
public Partial<ulong> DmChannel { get; set; }
public Partial<bool> AllowAutoproxy { get; set; }
public Partial<AbuseLogId?> AbuseLog { get; set; }
public override Query Apply(Query q) => q.ApplyPatch(wrapper => wrapper
.With("dm_channel", DmChannel)
.With("allow_autoproxy", AllowAutoproxy)
.With("abuse_log", AbuseLog)
);
public JObject ToJson()