Update ping command
This commit is contained in:
parent
01c4531129
commit
0cd5a4e21c
1 changed files with 13 additions and 14 deletions
|
@ -4,18 +4,17 @@ import MessageCommandContext from "../../../struct/MessageCommandContext";
|
||||||
import CommandCategory from "../../../struct/commands/CommandCategory";
|
import CommandCategory from "../../../struct/commands/CommandCategory";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ping',
|
name: "ping",
|
||||||
aliases: null,
|
aliases: null,
|
||||||
description: 'ping pong',
|
description: "ping pong",
|
||||||
category: CommandCategory.Miscellaneous,
|
category: CommandCategory.Miscellaneous,
|
||||||
run: async (message: MessageCommandContext, args: string[]) => {
|
run: async (message: MessageCommandContext) => {
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
message.reply(`Measuring...`)
|
message
|
||||||
|
.reply(`Measuring...`)
|
||||||
?.catch(console.error)
|
?.catch(console.error)
|
||||||
.then(msg => {
|
.then((msg) => {
|
||||||
if (msg) msg.edit({ content: `## Ping Pong!\n`
|
if (msg) msg.edit({ content: `## Ping Pong!\n` + `WebSocket: \`${client.events.ping() ?? "--"}ms\`\n` + `Message: \`${Math.round(Date.now() - now)}ms\`` });
|
||||||
+ `WS: \`${client.events.ping() ?? '--'}ms\`\n`
|
|
||||||
+ `Msg: \`${Math.round(Date.now() - now)}ms\`` });
|
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
} as SimpleCommand;
|
} as SimpleCommand;
|
||||||
|
|
Loading…
Reference in a new issue