added ping

This commit is contained in:
ishaan 2021-05-18 18:32:08 -04:00
parent f9a2e68c8b
commit 367816995d

20
cogs/pingCog.py Normal file
View file

@ -0,0 +1,20 @@
import discord
from discord.ext import commands
class ExampleCog(commands.Cog):
def __init__(self, client):
self.client = client
# Events
@commands.Cog.listener()
async def on_ready(self):
print('Bot is online.')
# Commands
@commands.command(aliases=['latency'])
async def ping(self, ctx):
await ctx.send(f'Pong! `{round(client.latency * 1000)}ms`')
def setup(client):
client.add_cog(ExampleCog(client))