poixpixel-discord-bot/source/commands/ping.ts
2024-03-03 17:43:26 -05:00

17 lines
530 B
TypeScript

import { SlashCommandBuilder, CommandInteraction } from "discord.js";
interface Command {
data: Omit<SlashCommandBuilder, "addSubcommand" | "addSubcommandGroup">;
execute: (interaction: CommandInteraction) => Promise<void>;
}
const command: Command = {
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Check the latency of the bot"),
execute: async (interaction) => {
await interaction.reply(`Pong! Latency: ${Date.now() - interaction.createdTimestamp}ms`);
},
};
export default command;