From d792a87be3f5e553b16f1411138004c310346d0e Mon Sep 17 00:00:00 2001 From: ddorn Date: Mon, 11 May 2020 03:56:05 +0200 Subject: [PATCH] :spakles: ping cmd --- src/cogs/misc.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cogs/misc.py b/src/cogs/misc.py index e782bf1..0f89516 100644 --- a/src/cogs/misc.py +++ b/src/cogs/misc.py @@ -165,6 +165,15 @@ class MiscCog(Cog, name="Divers"): await ctx.send(f"{msg} {bonus}") + @command(aliases=["pong"]) + async def ping(self, ctx): + """Affiche la latence avec le bot.""" + ping = time() + msg: discord.Message = await ctx.send("Pong !") + pong = time() + + await msg.edit(content=f"Pong ! Ça a pris {int(1000 * (pong - ping))}ms") + # ---------------- Jokes ---------------- # def load_jokes(self) -> List[Joke]: