Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ```python
  2. #!/usr/bin/python3
  3. # DELETE ALL MESSAGEZ
  4. # BY bisti
  5.  
  6. import asyncio
  7. import discord
  8. import re
  9.  
  10. c = discord.Client()
  11. token = "YOUR_TOKEN"
  12. channel_id = "CHANNEL_ID"
  13. deleted = 9999
  14.  
  15. @c.event
  16. async def on_ready():
  17. welcome = "Logged in as {0.name} - {0.id}".format(c.user)
  18. print(welcome)
  19. print("Trying to delete all messages in " + channel_id + " from username " + c.user.name)
  20. async for m in c.logs_from(c.get_channel(channel_id),limit=deleted):
  21. try:
  22. if m.author == c.user:
  23. await c.delete_message(m)
  24. except: pass
  25. print (str(deleted) + " messages were deleted")
  26. c.run(token, bot=False)
  27. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement