token = "" 
prefix = "." 

#--- CLEAR ---

import discord
from discord.ext import commands

print("[+] Logado com sucesso!")

bot = commands.Bot(command_prefix=prefix, self_bot=True)
bot.remove_command("help")

@bot.event
async def on_ready():
    print("\n\n[+] Pronto! Aguardo seu comando...") 
    print(f"[+] Name: {bot.user.name}")
    print(f"[+] ID: {bot.user.id}\n\n")

@bot.command()
async def cl(ctx, limit: int=None):
    passed = 0
    failed = 0
    async for msg in ctx.message.channel.history(limit=limit):
        if msg.author.id == bot.user.id:
            try:
                await msg.delete()
                passed += 1
            except:
                failed += 1
    print(f"[+] Removido [{passed}] mensagens - [{failed}] falhas")

bot.run(token, bot=False)