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:
Troubleshooting:
- Make a call to
https://slack.com/api/conversations.list?types=public_channel%2Cprivate_channel%2Cmpim%2Cim&pretty=1&token=TOKEN