All Projects → Symantec → Slack Autoarchive

Symantec / Slack Autoarchive

Licence: apache-2.0
If there has been no activity in a channel for awhile, you can automatically archive it using a cronjob.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Slack Autoarchive

Jenkins Ue4
Automated Unreal Engine 4 Project Builds
Stars: ✭ 206 (+112.37%)
Mutual labels:  automation, slack
Gatus
⛑ Gatus - Automated service health dashboard
Stars: ✭ 1,203 (+1140.21%)
Mutual labels:  automation, slack
Pokemongo Bot
The Pokemon Go Bot, baking with community.
Stars: ✭ 3,730 (+3745.36%)
Mutual labels:  automation, slack
Slacky
🐍 The BEST Slack Selfbot on GitHub | No Bot User, Acts Like It's You! ⭐️
Stars: ✭ 80 (-17.53%)
Mutual labels:  automation, slack
Diun
Receive notifications when an image is updated on a Docker registry
Stars: ✭ 704 (+625.77%)
Mutual labels:  automation, slack
Rocket.chat.ansible
Deploy Rocket.Chat with Ansible!
Stars: ✭ 80 (-17.53%)
Mutual labels:  automation, slack
Coteafs Appium
📱 Wrapper Appium Framework in Java which supports Automation of Mobile and Tablet apps.
Stars: ✭ 93 (-4.12%)
Mutual labels:  automation
Terraform Import Github Organization
Script to fully automate Terraform import of Github Org (teams, users, and repos)
Stars: ✭ 95 (-2.06%)
Mutual labels:  automation
Lotus
Kubernetes controller for running load testing
Stars: ✭ 92 (-5.15%)
Mutual labels:  automation
Slack cleaner2
📝 Python3 module for deleting Slack messages and files using the Slack REST API
Stars: ✭ 92 (-5.15%)
Mutual labels:  slack
Gocd Slack Build Notifier
GoCD (gocd.org) plugin to push build notifications to Slack
Stars: ✭ 96 (-1.03%)
Mutual labels:  slack
Ki
⌘ Work in macOS like you work in vim <currently under construction>
Stars: ✭ 96 (-1.03%)
Mutual labels:  automation
Cazador unr
Hacking tools
Stars: ✭ 95 (-2.06%)
Mutual labels:  automation
Go Siva
siva - seekable indexed verifiable archiver
Stars: ✭ 93 (-4.12%)
Mutual labels:  archive
Mzip Android
An Android compress and extract library support popular compression format such as rar, zip
Stars: ✭ 95 (-2.06%)
Mutual labels:  archive
Coderr.server
Replace logfiles with Coderr to correct bugs faster and more efficiently.
Stars: ✭ 92 (-5.15%)
Mutual labels:  automation
Channelsurf
Move from Slack to Microsoft Teams and manage your Teams environment
Stars: ✭ 96 (-1.03%)
Mutual labels:  slack
Combine Csv Files In The Folder
Tiny script to automate everyday task
Stars: ✭ 91 (-6.19%)
Mutual labels:  automation
Aws Workflows On Github
Workflows for automation of AWS services setup from Github CI/CD
Stars: ✭ 95 (-2.06%)
Mutual labels:  automation
Spincycle
Automate and expose complex infrastructure tasks to teams and services.
Stars: ✭ 95 (-2.06%)
Mutual labels:  automation

Autoarchive unused slack channels

Requirements

  • python3
  • Install requirements.txt ( pip install -r requirements.txt )
  • An OAuth token from a Slack app on your workspace that has the following permission scopes:
    • channels:history
    • channels:read
    • channels:write
    • chat:write:bot
    • chat:write:user

Example Usages

The SLACK_TOKEN must be exposed as a environment variable before running your script. By default, the script will do a DRY_RUN. To perform a non-dry run, specify DRY_RUN=false as an environment variable as well. See sample usages below.

# Run the script in dry run archive mode...This will output a list of channels that will be archived.
SLACK_TOKEN=<TOKEN> python slack_autoarchive.py

# Run the script in active archive mode...THIS WILL ARCHIVE CHANNELS!
DRY_RUN=false SLACK_TOKEN=<TOKEN> python slack_autoarchive.py

How can I exempt my channel from being archived?

You can add the string '%noarchive' to your channel purpose or topic. (There is also a whitelist file or env variable if you prefer.)

What Channels Will Be Archived

A channel will be archived by this script is it doesn't meet any of the following criteria:

  • Has non-bot messages in the past 60 days.
  • Is whitelisted. A channel is considered to be whitelisted if the channel name contains keywords in the WHITELIST_KEYWORDS environment variable. Multiple keywords can be provided, separated by comma.

What Happens When A Channel Is Archived By This Script

  • *Don't panic! It can be unarchived by following these instructions However all previous members would be kicked out of the channel and not be automatically invited back.
  • A message will be dropped into the channel saying the channel is being auto archived because of low activity
  • You can always whitelist a channel if it indeed needs to be kept despite meeting the auto-archive criteria.

Custom Archive Messages

Just before a channel is archived, a message will be sent with information about the archive process. The default message is:

This channel has had no activity for %s days. It is being auto-archived. If you feel this is a mistake you can <https://get.slack.help/hc/en-us/articles/201563847-Archive-a-channel#unarchive-a-channel|unarchive this channel> to bring it back at any point.'

To provide a custom message, simply edit templates.json.

Known Issues

  • Since slack doesn't have a batch API, we have to hit the api a couple times for each channel. This makes the performance of this script slow. If you have thousands of channels (which some people do), get some coffee and be patient.

Docker

  • First build the docker image (in the root of the project)

docker build --tag autoarchive .

  • run the container (dryrun is set to true by default)

docker run -e SLACK_TOKEN=<YOUR_AWESOME_TOKEN> autoarchive

  • if your ready to archive run

docker run -e SLACK_TOKEN=<YOUR_AWESOME_TOKEN> -e DRY_RUN=false autoarchive

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].