@commands.command()
@comnands.guild_only()
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount):
    'Purges X amount of messages from a channel'
    try:
        amount = int(amount)
    except ValueError:
        return (await ctx.send('Enter a number only!'))
    try:
        (await ctx.channel.purge(limit=(amount + 1)))
        (await ctx.send(f'Purged **{amount}** messages', delete_after=3))
    except discord.Forbidden:
        (await ctx.send(f'I need the `Manage Messages` permission to do this.'))
Purges X amount of messages from a channel
@commands.command()
@comnands.guild_only()
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, amount):
    
    try:
        amount = int(amount)
    except ValueError:
        return (await ctx.send('Enter a number only!'))
    try:
        (await ctx.channel.purge(limit=(amount + 1)))
        (await ctx.send(f'Purged **{amount}** messages', delete_after=3))
    except discord.Forbidden:
        (await ctx.send(f'I need the `Manage Messages` permission to do this.'))