Basic Bot setup
This commit is contained in:
19
src/commands/misc/ping.ts
Normal file
19
src/commands/misc/ping.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user