Skip to content

Commit

Permalink
Edit the message the bot sends in ping.ts (#33)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yorunoken and YoruNoKen authored Dec 30, 2023
1 parent d4843ec commit 89a7c59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/message-commands/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { MessageCommand } from "@lilybird/handlers";
export default {
name: "ping",
run: async (message) => {
await message.reply({
const newMessage = await message.reply({
content: "🏓...",
});

const { ws, rest } = await message.client.ping();

await message.edit({
await newMessage.edit({
content: `🏓 WebSocket: \`${ws}ms\` | Rest: \`${rest}ms\``,
});
},
Expand Down

0 comments on commit 89a7c59

Please sign in to comment.