re-added .xpex and .xpexl commands as there was no way to exclude users and roles from the xp system anymore

This commit is contained in:
Toastie 2025-03-19 11:22:58 +13:00
parent ca46786c5e
commit 1d667db598
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
19 changed files with 631 additions and 169 deletions
src/EllieBot/Db/Models/xp

View file

@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace EllieBot.Db.Models;
public class XpExcludedItem
{
[Key]
public int Id { get; set; }
public ulong GuildId { get; set; }
public XpExcludedItemType ItemType { get; set; }
public ulong ItemId { get; set; }
}
public sealed class XpExclusionEntityConfig : IEntityTypeConfiguration<XpExcludedItem>
{
public void Configure(EntityTypeBuilder<XpExcludedItem> builder)
{
builder.HasIndex(x => x.GuildId);
builder.HasAlternateKey(x => new
{
x.GuildId,
x.ItemType,
x.ItemId
});
}
}