Fix error message when using close command after already having set a close reason
This commit is contained in:
parent
9fcd1ddeac
commit
3a602db94f
1 changed files with 9 additions and 1 deletions
|
@ -43,7 +43,15 @@ public class CloseCommand
|
|||
.AddComponents(new DiscordButtonComponent(DiscordButtonStyle.Danger, "supportchild_closeconfirm", "Confirm"));
|
||||
|
||||
await command.RespondAsync(confirmation);
|
||||
closeReasons.Add(command.Channel.Id, reason);
|
||||
|
||||
if (closeReasons.TryGetValue(command.Channel.Id, out _))
|
||||
{
|
||||
closeReasons[command.Channel.Id] = reason;
|
||||
}
|
||||
else
|
||||
{
|
||||
closeReasons.Add(command.Channel.Id, reason);
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task OnConfirmed(DiscordInteraction interaction)
|
||||
|
|
Loading…
Add table
Reference in a new issue