Files
Femboy-Croissant-Bot/commands/utility/ping.js
2025-08-30 18:05:01 +02:00

24 lines
750 B
JavaScript

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] });
},
};