19 lines
599 B
TypeScript
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; |