Files
illegitimate-bot/src/commands/ping.js
2023-11-30 12:43:59 +01:00

38 lines
1.1 KiB
JavaScript

const { SlashCommandBuilder } = require("discord.js")
const { color, devMessage } = require("../../config/options.json")
module.exports = {
name: "ping",
description: "Get the bot's ping.",
type: "slash",
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Get the bot's ping."),
/**
* @param { import("discord.js").ChatInputCommandInteraction } interaction
* @param { import("discord.js").Client } client}
*/
async execute(interaction, client) {
await interaction.deferReply()
const embedColor = Number(color.replace("#", "0x"))
console.log(client.ws.ping)
await interaction.editReply({
embeds: [{
description: "Ping of the bot is " + client.ws.ping + "ms.",
color: embedColor,
footer: {
text: interaction.guild.name + " | " + devMessage,
icon_url: interaction.user.displayAvatarURL({ dynamic: true })
},
timestamp: new Date()
}]
})
}
}