From 96c3d6cbaa51fc298f001491a9384d8b643b7225 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:36:20 +1000 Subject: [PATCH] stop the unknown interaction error --- src/commands/statistics.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/statistics.ts b/src/commands/statistics.ts index f094092..94f2d55 100644 --- a/src/commands/statistics.ts +++ b/src/commands/statistics.ts @@ -5,6 +5,7 @@ import TClient from '../client.js'; import os from 'node:os'; export default { async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){ + const waitForData = await interaction.reply({content: '', fetchReply:true}) // Bytes conversion function formatBytes(bytes:number, decimals:number = 2) { if (bytes === 0) return '0 Bytes'; @@ -61,7 +62,7 @@ export default { `**Uptime:**\nHost: ${client.formatTime((os.uptime()*1000), 2, {longNames: true, commas: true})}\nBot: ${client.formatTime(client.uptime as number, 2, {commas: true, longNames: true})}` ].join('\n')} ); - interaction.reply({embeds: [embed], fetchReply: true}).then(x=>x.edit({embeds: [new client.embed(x.embeds[0].data).setFooter({text: `Load time: ${client.formatTime(x.createdTimestamp - interaction.createdTimestamp, 2, {longNames: true, commas: true})}`})]})) + waitForData.edit({content:null,embeds:[embed]}).then(x=>x.edit({embeds:[new client.embed(x.embeds[0].data).setFooter({text: `Load time: ${client.formatTime(x.createdTimestamp - interaction.createdTimestamp, 2, {longNames: true, commas: true})}`})]})) }, data: new Discord.SlashCommandBuilder() .setName('statistics')