2022-07-03 21:09:57 +02:00
|
|
|
import { SlashCommandBuilder } from '@discordjs/builders';
|
2022-07-20 23:01:47 +02:00
|
|
|
import { Client, CommandInteraction, Message } from 'discord.js';
|
2022-07-03 21:09:57 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
data: new SlashCommandBuilder()
|
|
|
|
.setName('ping')
|
|
|
|
.setDescription('Pong!'),
|
|
|
|
|
2022-07-20 23:01:47 +02:00
|
|
|
interaction: async (interaction: CommandInteraction, client: Client) => {
|
|
|
|
const sent = await interaction.reply({ content: 'Pinging...', fetchReply: true }) as Message;
|
2022-07-03 21:09:57 +02:00
|
|
|
|
|
|
|
interaction.editReply(
|
|
|
|
`Roundtrip latency: \
|
|
|
|
${sent.createdTimestamp - interaction.createdTimestamp}ms
|
|
|
|
Websocket heartbeat: ${client.ws.ping}ms.`);
|
|
|
|
},
|
|
|
|
};
|