makecord-create
Version:
Create advanced Discord Bots with Makecord - Now with TypeScript support
14 lines (11 loc) • 494 B
JavaScript
import { SlashCommandBuilder } from 'discord.js';
export default {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true });
const latency = sent.createdTimestamp - interaction.createdTimestamp;
await interaction.editReply(`Pong! Latency: ${latency}ms | API Latency: ${Math.round(interaction.client.ws.ping)}ms`);
},
};