19 lines
537 B
Python
19 lines
537 B
Python
import discord
|
|
from discord.ext import commands
|
|
|
|
|
|
class Utils(commands.Cog):
|
|
def __init__(self, bot):
|
|
self.bot = bot
|
|
|
|
@discord.slash_command(description="Greets the world.")
|
|
async def hello(self, ctx):
|
|
await ctx.respond('Hello world!')
|
|
|
|
@discord.slash_command(description="Sends the bot's latency.")
|
|
async def ping(self, ctx):
|
|
await ctx.respond('My ping is {:.0f}ms'.format(self.bot.latency*1000), ephemeral=True)
|
|
|
|
|
|
def setup(bot: commands.Bot):
|
|
bot.add_cog(Utils(bot))
|