Files
DiscordBotOceano/src/commands/misc/ping.ts
2024-04-07 12:11:59 +02:00

19 lines
599 B
TypeScript

import { Client, CommandInteraction } from "discord.js"
import CommandInterface from "../../utils/commandInterface";
const command: CommandInterface = {
name: "ping",
description: "Lasse die den Ping vom Bot anzeigen!",
callback: async (client: Client<true>, interaction: CommandInteraction) => {
await interaction.deferReply();
const reply = await interaction.fetchReply();
const ping = reply.createdTimestamp - interaction.createdTimestamp;
interaction.editReply(`Pong! Client ${ping}ms | Websocket: ${client.ws.ping}`);
}
}
export = command;