From bd82b23f1de23f0516035edb36667bf9730e8180 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sat, 3 Apr 2021 13:57:40 -0500 Subject: [PATCH] Attempt to add ping command --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index 847b038..7c3269c 100644 --- a/index.js +++ b/index.js @@ -59,6 +59,8 @@ client.on("message", async message => { case `${prefix}kulboard`: kulboardCreate(message) break; + case `${prefix}ping`: + ping(message); } if (message.content.toLowerCase().startsWith(`${prefix}bulkdelete`)) { @@ -78,6 +80,16 @@ client.on("message", async message => { } }); +async function ping(message) { + const pingEmbed = new Discord.MessageEmbed() + .setAuthor(message.author.tag, message.author.avatarURL()) + .setTitle("Pong!") + .addField(`🏓`, `${Date.now() - message.createdTimestamp}ms`) + .addField(`API`, `${Math.round(client.ws.ping)}ms`) + .setColor("00c5ff") + .setTimestamp(); +} + async function startLogs(message) { if (!message.member.hasPermission("ADMINISTRATOR")) { message.reply("you do not have admin permissions!");