Botanique/src/commands/misc/ping.js

18 lines
452 B
JavaScript
Raw Normal View History

import { SlashCommandBuilder } from '@discordjs/builders';
export default {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Pong!'),
interaction: async (interaction, client) => {
const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true });
interaction.editReply(
`Roundtrip latency: \
${sent.createdTimestamp - interaction.createdTimestamp}ms
Websocket heartbeat: ${client.ws.ping}ms.`);
},
};