implemented general help command and command specific help
This commit is contained in:
23
cogs/music/main.py
Normal file
23
cogs/music/main.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands.context import Context
|
||||
|
||||
import datetime
|
||||
import pytz
|
||||
|
||||
class music(commands.Cog):
|
||||
def __init__(self, client):
|
||||
self.name = "🎶 Music"
|
||||
self.emoji = "🎶"
|
||||
self.client = client
|
||||
|
||||
@commands.command(
|
||||
help="Displays latency from the bot",
|
||||
aliases=['delay'])
|
||||
async def ping(self, e: Context):
|
||||
start_time = datetime.datetime.now(pytz.utc)
|
||||
end_time = e.message.created_at
|
||||
|
||||
delay = int((end_time - start_time).total_seconds() * 1000)
|
||||
|
||||
await e.send(f"Pong! `{delay}MS`")
|
||||
Reference in New Issue
Block a user