From e78a7d0efad29ed848a39445275992f350c384a5 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 27 Dec 2024 07:00:06 +0000 Subject: [PATCH] change: adding a role to a sar group which already exists in another group will simply move it, instead of reporting success but not doing anything --- .../SelfAssignableRoles/SelfAssignedRolesService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NadekoBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs b/src/NadekoBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs index f16f3cebc..d3fb558be 100644 --- a/src/NadekoBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs +++ b/src/NadekoBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs @@ -59,10 +59,15 @@ public class SelfAssignedRolesService : INService, IReadyExecutor }, _ => new() { + SarGroupId = ctx.GetTable() + .Where(x => x.GuildId == guildId && x.GroupNumber == groupNumber) + .Select(x => x.Id) + .First() }, () => new() { RoleId = roleId, + GuildId = guildId, }); }