Skip to content

Instantly share code, notes, and snippets.

@kamoshi
Created June 2, 2021 14:35
Show Gist options
  • Save kamoshi/fb4b0d6c62af403418e7b861c28931cb to your computer and use it in GitHub Desktop.
Save kamoshi/fb4b0d6c62af403418e7b861c28931cb to your computer and use it in GitHub Desktop.
Wipe discord messages with a self bot (kinda illegal)
import discord
from discord.ext import commands
bot = commands.Bot(">>>", self_bot=True)
@bot.event
async def on_ready():
print("Bot presence t u r n e d on ( ͡° ͜ʖ ͡°)")
@bot.command()
async def testingmybotayaya(ctx):
channel: discord.TextChannel = bot.get_channel(CHANNEL_ID)
if not channel:
return await ctx.send("Fail")
async for message in channel.history(limit=900000):
if message.author == bot.user:
print("Deleted")
await message.delete()
bot.run(ACCOUNT_TOKEN, bot=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment