You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
505 B
18 lines
505 B
2 years ago
|
import discord
|
||
|
from discord.ext import commands
|
||
|
|
||
|
class Basic(commands.Cog):
|
||
|
def __init__(self, bot):
|
||
|
self.bot = bot
|
||
|
|
||
2 years ago
|
@discord.slash_command(description="Greets the world.")
|
||
2 years ago
|
async def sayhello(self, ctx):
|
||
|
await ctx.respond('Hello world!')
|
||
|
|
||
2 years ago
|
@discord.slash_command(description="Sends the bot's latency.")
|
||
2 years ago
|
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))
|