Add files via upload
This commit is contained in:
23
commands/utility/ping.js
Normal file
23
commands/utility/ping.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
category: 'utility',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Replies with API latency and ICMP latency!'),
|
||||
async execute(interaction) {
|
||||
// --- API latency Discord ---
|
||||
const apiLatency = Math.round(interaction.client.ws.ping);
|
||||
|
||||
// --- Reply final ---
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('🏓 Ping Status')
|
||||
.addFields(
|
||||
{ name: '🌐 API Latency', value: `${apiLatency}ms`, inline: true }
|
||||
)
|
||||
.setTimestamp();
|
||||
|
||||
await interaction.reply({ embeds: [embed] });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user