slack-archivebot

command module
v0.0.0-...-238c107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2016 License: MIT Imports: 8 Imported by: 0

README

slack-archivebot

A simple Go app that will automatically archive public channels on the following criteria:

  • if the channel is empty; or
  • if the channel has had no activity for the last X days.

Use

The poject uses godep to manage dependencies, so you'll need that. Once you've cloned this repo into your $GOPATH:

cd path/to/slack-archivebot
godep go build
./slack-archivebot

Deployment

Heroku is the simplest option. The script can run quite happily on a free dyno using the Heroku Scheduler add-on.

Deploy to Heroku

Note: the above will deploy the app to your Heroku account, and add the Scheduler add-on, but won't configure it to run. To do this, go to your dashboard, find the appropriate app, open the Scheduler add-on, and add a new job that runs slack-archivebot every 10 minutes.

Configuration

The following environment variables are used to configure the script:

  • ARCHIVEBOT_SLACK_TOKEN: the Slack Web API key for your team.
  • ARCHIVEBOT_INACTIVITY_DAYS: the number of days' inactivity after which to archive a channel (default: 30).
  • ARCHIVEBOT_NOTIFY: a Slack user or channel (e.g. #general or @tblair) to notify when something goes wrong.

Note: you must use an API key for a regular Slack user account. You cannot use a bot user account, because bot users don't have permission to archive channels.

Licensing and Attribution

slack-archivebot is released under the MIT license as detailed in the LICENSE file that should be distributed with this library; the source code is freely available.

slack-archivebot was developed by Tim Blair during a Venntro hack day.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/golang.org/x/net/websocket
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.
Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL