Files
aikaterna-cogs/pingtime/pingtime.py
aikaterna d8cd36f8ff [V3] RC1 Compliance, fixes
RC1 changes on all cogs. Tools has inrole fixed, now will display appropriately if 0 people are in the specified role. Timezone: removed the time place command as timezoneapi.io has changed to a paid service.
2018-10-06 12:06:54 -07:00

19 lines
482 B
Python

from redbot.core import commands
BaseCog = getattr(commands, "Cog", object)
class Pingtime(BaseCog):
"""🏓"""
def __init__(self, bot):
self.bot = bot
@commands.command()
async def pingtime(self, ctx):
"""Ping pong."""
latencies = self.bot.latencies
msg = "Pong!\n"
for shard, pingt in latencies:
msg += "Shard {}/{}: {}ms\n".format(shard + 1, len(latencies), round(pingt * 1000))
await ctx.send(msg)