From f0ddf67d52639ce063fae0c2d51a2873acd5571c Mon Sep 17 00:00:00 2001 From: Nico <90014028+NicoGaming77@users.noreply.github.com> Date: Thu, 1 Dec 2022 11:11:40 +1030 Subject: [PATCH] Update app.js Made the ping command actually ping the bot. --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index bd9717f..c762fbc 100644 --- a/app.js +++ b/app.js @@ -5,7 +5,7 @@ const { Client, Routes } = require('discord.js'); const ping = { name: 'ping', - description: 'yes' + description: 'Pings the bot and shows the latency' }; @@ -24,7 +24,7 @@ const rl = createInterface({ input: process.stdin, output: process.stdout }); client.on('interactionCreate', (interaction) => { if (interaction.commandName === 'ping') { - interaction.reply('yes'); + interaction.reply(`Latency is ${Date.now() - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`); } else if(interaction.commandName === 'command2') { // This is the example command's name! interaction.reply('example command'); } else { // a response if you forget to add the command here