Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```python
- #!/usr/bin/python3
- # DELETE ALL MESSAGEZ
- # BY bisti
- import asyncio
- import discord
- import re
- c = discord.Client()
- token = "YOUR_TOKEN"
- channel_id = "CHANNEL_ID"
- deleted = 9999
- @c.event
- async def on_ready():
- welcome = "Logged in as {0.name} - {0.id}".format(c.user)
- print(welcome)
- print("Trying to delete all messages in " + channel_id + " from username " + c.user.name)
- async for m in c.logs_from(c.get_channel(channel_id),limit=deleted):
- try:
- if m.author == c.user:
- await c.delete_message(m)
- except: pass
- print (str(deleted) + " messages were deleted")
- c.run(token, bot=False)
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement