mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
fix: Fixed many issues with 5.2.0
This commit is contained in:
@@ -283,7 +283,13 @@ public partial class Administration
|
||||
{
|
||||
var res = await _service.SetExclusiveButtonRoles(ctx.Guild.Id, messageId, exclusive.Value);
|
||||
|
||||
if (res)
|
||||
if (!res)
|
||||
{
|
||||
await Response().Error(strs.btnrole_not_found).SendAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
if (exclusive.Value)
|
||||
{
|
||||
await Response().Confirm(strs.btnrole_exclusive).SendAsync();
|
||||
}
|
||||
|
@@ -126,7 +126,11 @@ public sealed class ButtonRolesService : INService, IReadyExecutor
|
||||
Emote = emoteStr,
|
||||
Label = string.Empty,
|
||||
ButtonId = $"{BTN_PREFIX}:{guildId}:{guid}",
|
||||
Exclusive = (uow.GetTable<ButtonRole>().Where(x => x.GuildId == guildId && x.MessageId == messageId).All(x => x.Exclusive))
|
||||
Exclusive = uow.GetTable<ButtonRole>()
|
||||
.Any(x => x.GuildId == guildId && x.MessageId == messageId)
|
||||
&& uow.GetTable<ButtonRole>()
|
||||
.Where(x => x.GuildId == guildId && x.MessageId == messageId)
|
||||
.All(x => x.Exclusive)
|
||||
},
|
||||
_ => new()
|
||||
{
|
||||
@@ -178,7 +182,6 @@ public sealed class ButtonRolesService : INService, IReadyExecutor
|
||||
.UpdateAsync((_) => new()
|
||||
{
|
||||
Exclusive = exclusive
|
||||
})
|
||||
> 0;
|
||||
}) > 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user