Remove some unnecessary variables
This commit is contained in:
parent
2db90a44c7
commit
24defe0128
1 changed files with 4 additions and 6 deletions
|
@ -47,11 +47,9 @@ public class CloseCommand
|
|||
public static async Task OnConfirmed(DiscordInteraction interaction)
|
||||
{
|
||||
await interaction.CreateResponseAsync(DiscordInteractionResponseType.DeferredMessageUpdate);
|
||||
ulong channelID = interaction.Channel.Id;
|
||||
string channelName = interaction.Channel.Name;
|
||||
|
||||
// Check if ticket exists in the database
|
||||
if (!Database.TryGetOpenTicket(channelID, out Database.Ticket ticket))
|
||||
if (!Database.TryGetOpenTicket(interaction.Channel.Id, out Database.Ticket ticket))
|
||||
{
|
||||
await interaction.EditOriginalResponseAsync(new DiscordWebhookBuilder().AddEmbed(new DiscordEmbedBuilder
|
||||
{
|
||||
|
@ -78,7 +76,7 @@ public class CloseCommand
|
|||
}
|
||||
|
||||
string closeReason = "";
|
||||
if (closeReasons.TryGetValue(channelID, out string cachedReason))
|
||||
if (closeReasons.TryGetValue(interaction.Channel.Id, out string cachedReason))
|
||||
{
|
||||
closeReason = "\nReason: " + cachedReason + "\n";
|
||||
}
|
||||
|
@ -139,7 +137,7 @@ public class CloseCommand
|
|||
}
|
||||
|
||||
Database.ArchiveTicket(ticket);
|
||||
Database.TryDeleteInterview(channelID);
|
||||
Database.TryDeleteInterview(interaction.Channel.Id);
|
||||
|
||||
await interaction.EditOriginalResponseAsync(new DiscordWebhookBuilder().AddEmbed(new DiscordEmbedBuilder
|
||||
{
|
||||
|
@ -155,6 +153,6 @@ public class CloseCommand
|
|||
|
||||
Database.DeleteOpenTicket(ticket.id);
|
||||
|
||||
closeReasons.Remove(channelID);
|
||||
closeReasons.Remove(interaction.Channel.Id);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue