From 30e9fc328f791b8f933dba3051cb87d6329b26e2 Mon Sep 17 00:00:00 2001 From: Raatty <39517058+Raatty@users.noreply.github.com> Date: Tue, 22 May 2018 21:17:36 +1200 Subject: [PATCH] ping with times --- src/cogs/example.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cogs/example.py b/src/cogs/example.py index b8e88c8..7390442 100644 --- a/src/cogs/example.py +++ b/src/cogs/example.py @@ -14,7 +14,11 @@ class CogName: @commands.command() async def ping(self, ctx): """Say pong""" - await ctx.send('Pong') + now = ctx.message.created_at + msg = await ctx.send('Pong') + sub = msg.created_at - now + await ctx.edit(content=f'Pong, {sub.total_seconds() * 1000}) + def setup(bot): - bot.add_cog(CogName(bot)) \ No newline at end of file + bot.add_cog(CogName(bot))