feat: add command blacklisting

This commit is contained in:
Petal Ladenson 2026-01-12 17:14:12 -07:00
parent 1cb554e9c5
commit a3aa02e779
12 changed files with 155 additions and 8 deletions

View file

@ -33,6 +33,7 @@ public class MessageContext
public ulong? LogChannel { get; }
public bool InProxyBlacklist { get; }
public bool InCommandBlacklist { get; }
public bool InLogBlacklist { get; }
public bool LogCleanupEnabled { get; }
public bool RequireSystemTag { get; }

View file

@ -9,7 +9,7 @@ namespace PluralKit.Core;
internal class DatabaseMigrator
{
private const string RootPath = "PluralKit.Core.Database"; // "resource path" root for SQL files
private const int TargetSchemaVersion = 54;
private const int TargetSchemaVersion = 55;
private readonly ILogger _logger;
public DatabaseMigrator(ILogger logger)

View file

@ -6,6 +6,7 @@ public class GuildConfig
public ulong? LogChannel { get; }
public ulong[] LogBlacklist { get; }
public ulong[] ProxyBlacklist { get; }
public ulong[] CommandBlacklist { get; }
public bool LogCleanupEnabled { get; }
public bool InvalidCommandResponseEnabled { get; }
public bool RequireSystemTag { get; }

View file

@ -7,6 +7,7 @@ public class GuildPatch: PatchObject
public Partial<ulong?> LogChannel { get; set; }
public Partial<ulong[]> LogBlacklist { get; set; }
public Partial<ulong[]> ProxyBlacklist { get; set; }
public Partial<ulong[]> CommandBlacklist { get; set; }
public Partial<bool> LogCleanupEnabled { get; set; }
public Partial<bool> InvalidCommandResponseEnabled { get; set; }
public Partial<bool> RequireSystemTag { get; set; }
@ -16,6 +17,7 @@ public class GuildPatch: PatchObject
.With("log_channel", LogChannel)
.With("log_blacklist", LogBlacklist)
.With("proxy_blacklist", ProxyBlacklist)
.With("command_blacklist", CommandBlacklist)
.With("log_cleanup_enabled", LogCleanupEnabled)
.With("invalid_command_response_enabled", InvalidCommandResponseEnabled)
.With("require_system_tag", RequireSystemTag)