feat: guild ban add/remove logging, store banned systems in database

This commit is contained in:
sam 2024-10-13 14:58:44 +02:00
parent ca99bdfb94
commit 8e030acaf3
12 changed files with 227 additions and 36 deletions

View file

@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema;
using Catalogger.Backend.Extensions;
using Catalogger.Backend.Services;
using Remora.Rest.Core;
namespace Catalogger.Backend.Database.Models;
@ -14,6 +15,9 @@ public class Guild
public List<string> BannedSystems { get; init; } = [];
public List<ulong> KeyRoles { get; init; } = [];
public bool IsSystemBanned(PluralkitApiService.PkSystem system) =>
BannedSystems.Contains(system.Id) || BannedSystems.Contains(system.Uuid.ToString());
public bool IsMessageIgnored(Snowflake channelId, Snowflake userId)
{
if (