how can I add slash commands to my discord.py code example

Example 1: discord py slash commands

import discord											# Imports 
from discord.ext import commands						# Imports 
from discord_slash import SlashCommand, SlashContext	# Imports 

bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())	# Creates client
slash = SlashCommand(bot)

@slash.slash(name="test")							# Sets the name of the command
async def _test(ctx: SlashContext):					# Wheen command "test" is used
    embed = discord.Embed(title="embed test")		# Creates a embed
    await ctx.send(content="test", embeds=[embed])	# Sends the embed

bot.run("discord_token")	# Put your token here

Example 2: discord.py aliases

@commands.command(name='test', aliases=['testcommand', 'testing'])
async def test(self, ctx):
    await ctx.send("This a test command")

#will run with either 'test, testcommand or testing