mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
- Renamed CustomReaction model to NadekoExpression
- Used structured logging everywhere
This commit is contained in:
@@ -7,12 +7,12 @@ namespace NadekoBot.Db;
|
||||
|
||||
public static class NadekoExpressionExtensions
|
||||
{
|
||||
public static int ClearFromGuild(this DbSet<CustomReaction> exprs, ulong guildId)
|
||||
public static int ClearFromGuild(this DbSet<NadekoExpression> exprs, ulong guildId)
|
||||
=> exprs.Delete(x => x.GuildId == guildId);
|
||||
|
||||
public static IEnumerable<CustomReaction> ForId(this DbSet<CustomReaction> exprs, ulong id)
|
||||
public static IEnumerable<NadekoExpression> ForId(this DbSet<NadekoExpression> exprs, ulong id)
|
||||
=> exprs.AsNoTracking().AsQueryable().Where(x => x.GuildId == id).ToList();
|
||||
|
||||
public static CustomReaction GetByGuildIdAndInput(this DbSet<CustomReaction> exprs, ulong? guildId, string input)
|
||||
public static NadekoExpression GetByGuildIdAndInput(this DbSet<NadekoExpression> exprs, ulong? guildId, string input)
|
||||
=> exprs.FirstOrDefault(x => x.GuildId == guildId && x.Trigger.ToUpper() == input);
|
||||
}
|
Reference in New Issue
Block a user