Discord-py-slash-command not recognised

You can write slash commands using only discord.py like this:

from discord import app_commands

tree = app_commands.CommandTree(client)

@tree.command(name="ping", description="Shows bot latency")
async def ping(interaction):
    await interaction.response.send_message(f"Pong: `{round(client.latency, 3)}`")