Add slash commands support #20
1 changed files with 17 additions and 0 deletions
17
src/commands/misc/ping.js
Normal file
17
src/commands/misc/ping.js
Normal 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.`);
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue