how can I add slash commands to my discord.py code example
Example 1: discord py slash commands
import discord
from discord.ext import commands
from discord_slash import SlashCommand, SlashContext
bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
slash = SlashCommand(bot)
@slash.slash(name="test")
async def _test(ctx: SlashContext):
embed = discord.Embed(title="embed test")
await ctx.send(content="test", embeds=[embed])
bot.run("discord_token")
Example 2: discord.py aliases
@commands.command(name='test', aliases=['testcommand', 'testing'])
async def test(self, ctx):
await ctx.send("This a test command")