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