Skip to content

Instantly share code, notes, and snippets.

@brettinternet
Created July 26, 2023 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettinternet/774afff99277352f717a5b2d6ccc31c2 to your computer and use it in GitHub Desktop.
Save brettinternet/774afff99277352f717a5b2d6ccc31c2 to your computer and use it in GitHub Desktop.
Delete your own messages in Slack channels
#!/usr/bin/python
from slack_cleaner2 import *
s = SlackCleaner('TOKEN')
channel = "CHANNEL_NAME"
for msg in s.c[channel].msgs(with_replies=True):
if msg.user == s.myself:
print(f"DELETED: {msg.text}")
msg.delete(replies=True, files=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment