From e67f659a8af007ac14d93812df6bb8af86127884 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 21 Jul 2021 18:55:08 +0200 Subject: [PATCH] Added a fix from 1.9 branch for repeaters --- .../Modules/Utility/Services/RepeaterService.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs b/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs index fed88fd70..a1e5e2965 100644 --- a/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs +++ b/src/NadekoBot/Modules/Utility/Services/RepeaterService.cs @@ -135,8 +135,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};") var toTrigger = await uow.Repeaters .AsNoTracking() + .Where(x => x.GuildId == guildId) .Skip(index) - .FirstOrDefaultAsyncEF(x => x.GuildId == guildId); + .FirstOrDefaultAsyncEF(); if (toTrigger is null) return false; @@ -361,8 +362,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};") using var uow = _db.GetDbContext(); var toRemove = await uow.Repeaters .AsNoTracking() + .Where(x => x.GuildId == guildId) .Skip(index) - .FirstOrDefaultAsyncEF(x => x.GuildId == guildId); + .FirstOrDefaultAsyncEF(); if (toRemove is null) return null; @@ -393,8 +395,9 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};") var toToggle = await uow .Repeaters .AsQueryable() + .Where(x => x.GuildId == guildId) .Skip(index) - .FirstOrDefaultAsyncEF(x => x.GuildId == guildId); + .FirstOrDefaultAsyncEF(); if (toToggle is null) return null;