From 861b1251a5429cd9c207884eae0ff5193dfe57ce Mon Sep 17 00:00:00 2001 From: Toastie Date: Fri, 29 Nov 2024 17:57:33 +1300 Subject: [PATCH] fixed .sclr again --- CHANGELOG.md | 13 +++++++++++++ src/EllieBot/EllieBot.csproj | 2 +- .../Services/Impl/GuildColorsService.cs | 18 +++++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a35bbaa..1d65da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o +## [5.2.2] - 29.11.2024 + +### Changed + +- Button roles are now non-exclusive by default + +### Fixed + +- Fixed sar migration, again (this time correctly) +- Fixed `.sclr` not updating unless bot is restarted, the changes should be immediate now for warn and error +- Fixed group buttons exclusivity message always saying groups are exclusive + + ## [5.2.1] - 28.11.2024 ### Fixed diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj index 50797b4..da51333 100644 --- a/src/EllieBot/EllieBot.csproj +++ b/src/EllieBot/EllieBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.2.1 + 5.2.2 $(MSBuildProjectDirectory) diff --git a/src/EllieBot/_common/Services/Impl/GuildColorsService.cs b/src/EllieBot/_common/Services/Impl/GuildColorsService.cs index d1f7618..86143ff 100644 --- a/src/EllieBot/_common/Services/Impl/GuildColorsService.cs +++ b/src/EllieBot/_common/Services/Impl/GuildColorsService.cs @@ -75,6 +75,14 @@ public sealed class GuildColorsService : IReadyExecutor, IGuildColorsService, IE { GuildId = guildId }); + + if (!_colors.TryAdd(guildId, new Colors(null, null, color?.ToDiscordColor()))) + { + _colors[guildId] = _colors[guildId] with + { + Error = color?.ToDiscordColor() + }; + } } public async Task SetPendingColor(ulong guildId, Rgba32? color) @@ -95,6 +103,14 @@ public sealed class GuildColorsService : IReadyExecutor, IGuildColorsService, IE { GuildId = guildId }); + + if (!_colors.TryAdd(guildId, new Colors(null, color?.ToDiscordColor(), null))) + { + _colors[guildId] = _colors[guildId] with + { + Pending = color?.ToDiscordColor() + }; + } } public async Task OnReadyAsync() @@ -127,4 +143,4 @@ public sealed class GuildColorsService : IReadyExecutor, IGuildColorsService, IE return clr.ToDiscordColor(); } -} +} \ No newline at end of file