mirror of
https://github.com/Octech2722/jeevesbot.git
synced 2026-02-04 11:42:43 -06:00
16 lines
611 B
Python
16 lines
611 B
Python
import discord
|
|
from discord.ext import commands
|
|
|
|
class Latency(commands.Cog):
|
|
|
|
def __init__(self, client):
|
|
self.client = client
|
|
|
|
@commands.command(aliases=['botping', 'botlatency']) # Creates a command just as you would in the bot.py file
|
|
async def latency(self, ctx): # ALWAYS need self then context
|
|
print(f'The user "{ctx.author.name}" in "{ctx.guild}" called a Latency Check!')
|
|
await ctx.send(f'Bot Latency: {round(self.client.latency * 1000)}ms')
|
|
print(f'Replied with {round(self.client.latency * 1000)}ms')
|
|
|
|
def setup(client):
|
|
client.add_cog(Latency(client)) |