From b4f7ac95b818dc226891e417120bf67afc542f97 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Thu, 30 Apr 2020 22:08:02 -0800 Subject: [PATCH] Change ping command --- geeksbot/exts/admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/geeksbot/exts/admin.py b/geeksbot/exts/admin.py index 3e6151e..0adaf59 100644 --- a/geeksbot/exts/admin.py +++ b/geeksbot/exts/admin.py @@ -5,6 +5,7 @@ import inspect import sys import psutil import math +import time from geeksbot.imports import utils admin_logger = logging.getLogger('admin') @@ -60,10 +61,10 @@ class Admin(commands.Cog): title=f'Pong 🏓', color=discord.Colour.green() ) + time1 = time.monotonic() msg = await ctx.send(embed=em) - time1 = ctx.message.created_at - time = (msg.created_at - time1).total_seconds() * 1000 - em.description = f'Response Time: **{math.ceil(time)}ms**\n' \ + time_dif = (time.monotonic() - time1) * 1000 + em.description = f'Response Time: **{math.ceil(time_dif)}ms**\n' \ f'Discord Latency: **{math.ceil(self.bot.latency*1000)}ms**' await msg.edit(embed=em)