From c42d5290160badd32b2af2e33531819c3cda85f8 Mon Sep 17 00:00:00 2001 From: Alan Beatty Date: Tue, 21 Dec 2021 00:00:45 +0000 Subject: [PATCH] Fix color for ban DMs with plain text ban message. --- .../Modules/Administration/Services/UserPunishService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs b/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs index be357e140..8f1f9ebbb 100644 --- a/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs +++ b/src/NadekoBot/Modules/Administration/Services/UserPunishService.cs @@ -499,7 +499,9 @@ WHERE GuildId={guildId} { template = JsonConvert.SerializeObject(new { - color = _bcs.Data.Color.Error, + //To get the decimal version of the color that's expected, take the packed value of the Rgba32 + //and bitshift it to the right by 8 bits, thereby dropping the "a" and getting a reprensentation of the RGB value + color = _bcs.Data.Color.Error.PackedValue >> 8, description = defaultMessage }); } @@ -514,7 +516,9 @@ WHERE GuildId={guildId} { template = JsonConvert.SerializeObject(new { - color = _bcs.Data.Color.Error, + //To get the decimal version of the color that's expected, take the packed value of the Rgba32 + //and bitshift it to the right by 8 bits, thereby dropping the "a" and getting a reprensentation of the RGB value + color = _bcs.Data.Color.Error.PackedValue >> 8, description = template }); }