It is a serverless function that periodically delete old attatchment files.
Using Slack's LEGACY TOKEN to check old files, and delete them all. LEGACY TOKEN needs to be create manually, but AWS side automates environment construction by using Serverless Framework.
- AWS Account
- Serverless Framework
- serverless-plugin-aws-alerts (optional)
- Slack Account / Administrator Role
-
Create LEGACY TOKEN from Here
-
Clone this repo.
$ git clone https://github.com/saitota/SlackFileCleaner.git
- Modify environment_dev.yml 's two TOKEN to your token.
LEGACY_TOKEN: 'xoxp-000000000000-000000000000-000000000000-0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x0x'
- Deploy with Serverless Framework (you must aws-cli initialize before)
$ sls deploy ./SlackFileCleaner
...
api keys:
None
endpoints:
None
functions:
fnc: SlackFileCleaner-dev-fnc
- Done! Wait a time to archive. (12:30 JST is the default)
I will write article about this function.