From 93b9939066150862f1c5f47aa5d9c363563d6e77 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 14 Mar 2021 20:22:40 -0600 Subject: [PATCH] general.ping: use editedTimestamp if avaliable --- src/modules/general.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/general.js b/src/modules/general.js index c1b149e..0095621 100644 --- a/src/modules/general.js +++ b/src/modules/general.js @@ -125,7 +125,9 @@ ping.description = "Measures response times to Discord."; ping.addAlias("p"); ping.callback = async function (msg) { const newMsg = await msg.channel.createMessage("Pong."); - const rtt = Math.floor(newMsg.timestamp - msg.timestamp); + const rtt = Math.floor( + newMsg.timestamp - (msg.editedTimestamp || msg.timestamp) + ); const gateway = hf.bot.shards.get( hf.bot.guildShardMap[hf.bot.channelGuildMap[msg.channel.id]] || 0 ).latency;