Created
March 9, 2020 15:00
-
-
Save jameshd/0b2cc51de99a32c767a1ac20eed5cdcd to your computer and use it in GitHub Desktop.
Slack Cleaner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# You'll need python and pip installed + a slack token | |
# https://api.slack.com/legacy/custom-integrations/legacy-tokens | |
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
# python get-pip.py | |
# pip install slack-cleaner | |
## READ THE DOCS https://github.com/sgratzl/slack-cleaner | |
TOKEN=$1 | |
me="my.slackusername" | |
now=$(date +%y%m%d) | |
users=( | |
"a.person" | |
"another.person" | |
"onemore.person" | |
) | |
for i in "${users[@]}" | |
do | |
$(which slack-cleaner) --token $TOKEN --message --user $me --rate 1 --direct $i --before $now --perform | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chmod +x ./clean.sh | |
clean.sh <slack-token-here> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment