Don't cache empty close reasons
This commit is contained in:
parent
ff2a9e54e4
commit
df2f2e63c9
1 changed files with 9 additions and 6 deletions
|
@ -46,13 +46,16 @@ public class CloseCommand
|
|||
|
||||
await command.RespondAsync(confirmation);
|
||||
|
||||
if (closeReasons.TryGetValue(command.Channel.Id, out _))
|
||||
if (!string.IsNullOrWhiteSpace(reason))
|
||||
{
|
||||
closeReasons[command.Channel.Id] = reason;
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue