Edit the message the bot sends in ping.ts (#33)

In `message-commands/ping.ts`, the code attempts to edit the message the
author sent, resulting in an error on line 12.
This pr fixes that bug

Co-authored-by: YoruNoKen <yorunoken@skiff.com>
This commit is contained in:
Yoru 2023-12-30 23:04:40 +03:00 committed by GitHub
parent d4843ecbee
commit 89a7c5922f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,13 +3,13 @@ import { MessageCommand } from "@lilybird/handlers";
export default { export default {
name: "ping", name: "ping",
run: async (message) => { run: async (message) => {
await message.reply({ const newMessage = await message.reply({
content: "🏓...", content: "🏓...",
}); });
const { ws, rest } = await message.client.ping(); const { ws, rest } = await message.client.ping();
await message.edit({ await newMessage.edit({
content: `🏓 WebSocket: \`${ws}ms\` | Rest: \`${rest}ms\``, content: `🏓 WebSocket: \`${ws}ms\` | Rest: \`${rest}ms\``,
}); });
}, },