mirror of https://codeberg.org/soteria/sox.git
22 lines
858 B
Python
22 lines
858 B
Python
from disnake.ext import plugins
|
|
|
|
import disnake
|
|
|
|
plugin = plugins.Plugin()
|
|
|
|
@plugin.slash_command(description="ping da bot real")
|
|
async def ping(inter: disnake.CommandInteraction):
|
|
em = disnake.Embed(title="Pong!", description=f"Ping - {int(plugin.bot.latency * 1000)}ms\nWritten with love in Python")
|
|
em.set_thumbnail(plugin.bot.user.avatar.url)
|
|
await inter.response.send_message(embed=em)
|
|
|
|
@plugin.slash_command(description="help me!", name="help")
|
|
async def help_command(inter: disnake.CommandInteraction):
|
|
desc = ""
|
|
for cmd in plugin.bot.global_application_commands:
|
|
desc += f"**{cmd.name}** - {cmd.description}\n\n"
|
|
em = disnake.Embed(title="Commands", description=desc)
|
|
em.set_thumbnail(plugin.bot.user.avatar.url)
|
|
await inter.response.send_message(embed=em)
|
|
|
|
setup, teardown = plugin.create_extension_handlers() |