Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active March 8, 2021 06:11
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 ruanbekker/a05472ce1b3df6f172e656c309463461 to your computer and use it in GitHub Desktop.
Save ruanbekker/a05472ce1b3df6f172e656c309463461 to your computer and use it in GitHub Desktop.
Delete Messages from Slack

Update: Install slack-cleaner2 as the normal one fails with invalid auth

install slack-cleaner:

$ pip install slack-cleaner

Get your legacy token: https://api.slack.com/custom-integrations/legacy-tokens

Delete messages from channel sent by users: system_events in this case

$ slack-cleaner --token=xoxp-xx --message --group system_events --user "*" --perform --rate=20

Delete messages from channel sent by bots: system_events in this case

$ slack-cleaner --token=xoxp-xx --message --group system_events --bot --perform --rate=20

Be aware of rate limits:

Resource:

image

Troubleshooting:

  • Make a call to https://slack.com/api/conversations.list?types=public_channel%2Cprivate_channel%2Cmpim%2Cim&pretty=1&token=TOKEN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment