added basic functions
This commit is contained in:
14
discordbot/commands/ping.js
Normal file
14
discordbot/commands/ping.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { simpleEmbed } = require('../functions/embeds.js');
|
||||
const { client } = require('../index.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with Pong!'),
|
||||
async execute(interaction) {
|
||||
const reply = await interaction.reply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **Pinging...**`)], fetchReply: true, emphemeral: true });
|
||||
|
||||
interaction.editReply({ embeds: [simpleEmbed(`Websocket heartbeat: **${client.ws.ping}ms**\n Roundtrip latency: **${reply.createdTimestamp - interaction.createdTimestamp}ms**`)] });
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user