It is a serverless function that periodically archive old / no message channel.
DEMO:
Using Slack's LEGACY TOKEN to check channels, and archive old channel. This Lambda function starts periodically by AWS Cloudwatch Events. 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
-
Create LEGACY TOKEN from Here
-
Clone this repo.
$ git clone https://github.com/saitota/SlackChannelArchiver.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 ./SlackChannelArchiver
...
api keys:
None
endpoints:
None
functions:
fnc: SlackChannelArchiver-dev-fnc
- Done! Wait a time to archive. (12:00 JST is the default)
I wrote article about this function.