From 0cd5a4e21c715f211cfe93c0da2ba3cf30c66d86 Mon Sep 17 00:00:00 2001 From: Declan Chidlow Date: Fri, 12 Jul 2024 18:24:48 +0800 Subject: [PATCH] Update ping command --- bot/src/bot/commands/misc/ping.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/bot/src/bot/commands/misc/ping.ts b/bot/src/bot/commands/misc/ping.ts index c0fa5cf..360a130 100644 --- a/bot/src/bot/commands/misc/ping.ts +++ b/bot/src/bot/commands/misc/ping.ts @@ -4,18 +4,17 @@ import MessageCommandContext from "../../../struct/MessageCommandContext"; import CommandCategory from "../../../struct/commands/CommandCategory"; export default { - name: 'ping', - aliases: null, - description: 'ping pong', - category: CommandCategory.Miscellaneous, - run: async (message: MessageCommandContext, args: string[]) => { - let now = Date.now(); - message.reply(`Measuring...`) - ?.catch(console.error) - .then(msg => { - if (msg) msg.edit({ content: `## Ping Pong!\n` - + `WS: \`${client.events.ping() ?? '--'}ms\`\n` - + `Msg: \`${Math.round(Date.now() - now)}ms\`` }); - }); - } + name: "ping", + aliases: null, + description: "ping pong", + category: CommandCategory.Miscellaneous, + run: async (message: MessageCommandContext) => { + let now = Date.now(); + message + .reply(`Measuring...`) + ?.catch(console.error) + .then((msg) => { + if (msg) msg.edit({ content: `## Ping Pong!\n` + `WebSocket: \`${client.events.ping() ?? "--"}ms\`\n` + `Message: \`${Math.round(Date.now() - now)}ms\`` }); + }); + }, } as SimpleCommand;