Don't cache empty close reasons

This commit is contained in:
Toastie 2025-02-06 15:20:58 +13:00
parent ff2a9e54e4
commit df2f2e63c9
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -46,6 +46,8 @@ public class CloseCommand
await command.RespondAsync(confirmation);
if (!string.IsNullOrWhiteSpace(reason))
{
if (closeReasons.TryGetValue(command.Channel.Id, out _))
{
closeReasons[command.Channel.Id] = reason;
@ -55,6 +57,7 @@ public class CloseCommand
closeReasons.Add(command.Channel.Id, reason);
}
}
}
public static async Task OnConfirmed(DiscordInteraction interaction)
{