import discord from discord.ext import commands class Basic(commands.Cog): def __init__(self, bot): self.bot = bot @discord.slash_command() async def sayhello(self, ctx): await ctx.respond('Hello world!') @discord.slash_command() async def ping(self, ctx): await ctx.respond('My ping is {:.0f}ms'.format(self.bot.latency*1000), ephemeral=True) def setup(bot): bot.add_cog(Basic(bot))