Code for managing Cleanup of Stale Channels
You'll need to change configuration.yaml appropriately. warner.py and archiver.py should then work from the commandline. Productionalized automated deployments and running on a schedule are left unspecified because every production environment is unique.
The warner notifies channels that have been inactive for a period of time.
The archiver archives channels that have been inactive for a period of time.
The announcer will notify a channel of all new channels created within a period of time.
The flagger uses a ruleset defined in a specific channel to perform actions such as notifying channels of messages that have received a certain number of reactions.
You'll want to change this to the name of your Slack
Tune these two variables to decide how long after inactivity a channel should be warned for inactivity and then subsequently archived.
These three channels need to be manually created by you in your Slack.
- Make sure the Slackbot app is installed for your Slack
- Add a Slackbot integration, and copy the
token
parameter from the URL provided
The easiest way to get an API_TOKEN
is to generate an OAuth test token.
It's not nice, but it's simple and avoids the whole callback-URL-oauth-request-app-creation dance.
Destalinator can be chatty and make potentially big changes to a Slack team (by warning or archiving a large amount of channels), especially when first installed.
To minimize the risk of making a mistake, Destalinator will run in a dry-run mode unless the DESTALINATOR_ACTIVATED
environment variable exists. Set it to any non-empty value and Destalinator is "active." If you want to remain in dry-run mode, ensure this variable is unset/does not exist.