Files
illegitimate-bot/src/commands/ping.ts
2023-12-31 11:29:39 +01:00

37 lines
1.1 KiB
TypeScript

import { SlashCommandBuilder } from "discord.js"
import { color, devMessage } from "../../config/options.json"
import { Command } from "../interfaces"
export = {
name: "ping",
description: "Get the bot's ping.",
type: "slash",
dev: false,
public: true,
data: new SlashCommandBuilder()
.setName("ping")
.setDescription("Get's the bot's ping.")
.setDMPermission(false),
async execute(interaction, client) {
await interaction.deferReply()
const embedColor = Number(color.replace("#", "0x"))
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.guild?.iconURL({ forceStatic: false }) || undefined,
},
timestamp: new Date().toISOString(),
},
],
})
},
} as Command