From a325d264a39094512dc41935dd52d7d1e545282c Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Wed, 15 Mar 2023 00:08:01 +0000 Subject: [PATCH] Defer update on all admin panel button presses --- src/commands/nucleus/stats.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts index 1cbcee8..b7594ba 100644 --- a/src/commands/nucleus/stats.ts +++ b/src/commands/nucleus/stats.ts @@ -189,8 +189,8 @@ const callback = async (interaction: CommandInteraction): Promise => { return; } const guild = (await client.guilds.fetch(GuildID)) as Guild | null; + await i.deferUpdate(); if (!guild) { - await i.deferUpdate(); await interaction.editReply({ embeds: [ new EmojiEmbed().setTitle("Admin").setDescription("Not in server").setStatus("Danger") @@ -200,7 +200,6 @@ const callback = async (interaction: CommandInteraction): Promise => { return; } if (i.customId === "stats") { - await i.deferUpdate(); await interaction.editReply({ embeds: [ new EmojiEmbed() @@ -238,7 +237,6 @@ const callback = async (interaction: CommandInteraction): Promise => { components: [] }); } else if (i.customId === "data") { - await i.deferUpdate(); // Get all the data and convert to a string const data = await client.database.guilds.read(guild.id); const stringified = JSON.stringify(data, null, 2); @@ -277,7 +275,6 @@ const callback = async (interaction: CommandInteraction): Promise => { components: [] }); } else if (i.customId === "cache") { - await i.deferUpdate(); await client.memory.forceUpdate(guild.id); await interaction.editReply({ embeds: [