From 24defe01287c9bdf30871ba1299fb9a8d578f00a Mon Sep 17 00:00:00 2001 From: Toastie Date: Fri, 27 Dec 2024 01:39:46 +1300 Subject: [PATCH] Remove some unnecessary variables --- Commands/CloseCommand.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Commands/CloseCommand.cs b/Commands/CloseCommand.cs index 436b72e..ea569c1 100644 --- a/Commands/CloseCommand.cs +++ b/Commands/CloseCommand.cs @@ -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); } } \ No newline at end of file