____ _ _ | _ \ _____ _| |__ (_)_ __ | | | |/ _ \ \/ / '_ \| | '_ \ | |_| | (_) > <| |_) | | | | | |____/ \___/_/\_\_.__/|_|_| |_|
Title:scraapz666
Created:Sep 24th, 2020
Created by: Anonymous
Views: 286
Comments: 0
Username: Anonymous - (Login)
Please note that all posted information is publicly available and must follow our TOS.
token = "" prefix = "!" #--- BOT --- import discord from discord.ext import commands print("[Info] Logging into Discord") bot = commands.Bot(command_prefix=prefix, self_bot=True) bot.remove_command("help") @bot.event async def on_ready(): print("\n\n[Welcome] Ready! I await your command..") print(f"[Welcome] Name: {bot.user.name}") print(f"[Welcome] ID: {bot.user.id}\n\n") @bot.command() async def clear(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"[Complete] Removed {passed} messages with {failed} fails") bot.run(token, bot=False)