1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00

stop the unknown interaction error

This commit is contained in:
AnxietyisReal 2023-06-12 11:36:20 +10:00
parent f361ea84e6
commit b5e4f67f8c

View File

@ -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: '<a:sakjdfsajkfhsdjhjfsa:1065342869428252743>', 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')