'My command doesn't work when I switched to slash commands

My code doesn't work, idk why it worked before I switched to slash commands. Here's the error what I got:

if l is None or l > 100: TypeError: '>' not supported between instances of 'str' and 'int'

@commands.cooldown(1, 2, commands.BucketType.user)
@slash.slash(name="Clear", description="A clear command meant for you can delete thousands of messages at the same time.")
async def clear(ctx, amount = 1):
    await ctx.channel.purge(limit=amount)
    embed = discord.Embed(title=f"{amount} messages has been deleted!", color=discord.Color.teal())
    await ctx.send(embed=embed)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source