Add ping command

This commit is contained in:
Mylloon 2022-07-03 20:37:28 +02:00
parent 8f33f68fe6
commit 513244f203
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

17
src/commands/misc/ping.js Normal file
View file

@ -0,0 +1,17 @@
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.`);
},
};