i have not committed in years
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index 43a5fd7..ab23bf7 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -1,5 +1,6 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -7,8 +8,27 @@
.setName("ping")
.setDescription("Gets the bot's ping time")
-const callback = (interaction: CommandInteraction) => {
- interaction.reply("Command incomplete [nucleus/ping]");
+const callback = async (interaction: CommandInteraction) => {
+ // WEBSOCKET | Nucleus -> Discord
+ // EDITING | Nucleus -> discord -> nucleus | edit time / 2
+ let initial = new Date().getTime();
+ await interaction.reply({embeds: [new generateEmojiEmbed()
+ .setTitle("Ping")
+ .setDescription(`Checking ping times...`)
+ .setEmoji("NUCLEUS.LOADING")
+ .setStatus("Danger")
+ ], ephemeral: true});
+ let ping = new Date().getTime() - initial;
+ interaction.editReply({embeds: [new generateEmojiEmbed()
+ .setTitle("Ping")
+ .setDescription(
+ `**Ping:** \`${ping}ms\`\n` +
+ `**To Discord:** \`${interaction.client.ws.ping}ms\`\n` +
+ `**From Expected:** \`±${Math.abs((ping / 2) - interaction.client.ws.ping)}ms\``
+ )
+ .setEmoji("CHANNEL.SLOWMODE.OFF")
+ .setStatus("Danger")
+ ]})
}
const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {