Update pingtime.py

This commit is contained in:
aikaterna
2018-05-03 17:40:10 -07:00
committed by GitHub
parent f580e2483d
commit dad4e02ada

View File

@@ -10,8 +10,8 @@ class Pingtime:
@commands.command(pass_context=True)
async def pingtime(self, ctx):
"""Ping pong."""
channel = ctx.message.channel
t1 = time.perf_counter()
await channel.trigger_typing()
t2 = time.perf_counter()
await ctx.send("Pong: {}ms".format(round((t2-t1)*1000)))
latencies = self.bot.latencies
for shard, pingt in latencies:
msg = "Pong!\n"
msg += "Shard {}/{}: {}ms\n".format(shard + 1, len(latencies), round(pingt*1000))
await ctx.send(msg)