Refactoring, comments & overall improvements
This commit is contained in:
60 files changed
+1106
-708
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
import Client from "$lib/client.js";
|
||||
|
||||
import replies from "../lib/replies.js";
|
||||
|
||||
async function execute(client: Client, interaction: ChatInputCommandInteraction): Promise<void> {
|
||||
if (!interaction.isChatInputCommand()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const reply = await interaction.reply({ ...replies.ping(client.ws.ping), fetchReply: true });
|
||||
|
||||
await interaction.editReply(
|
||||
replies.ping(client.ws.ping, reply.createdTimestamp - interaction.createdTimestamp)
|
||||
);
|
||||
}
|
||||
|
||||
const data = new SlashCommandBuilder().setName("ping").setDescription("Try to ping me.");
|
||||
|
||||
export { data, execute };
|
||||
Reference in new issue
Block a user