https://github.com/johnagan/triagebot-example
A triage bot example for Slack
https://github.com/johnagan/triagebot-example
Last synced: about 1 year ago
JSON representation
A triage bot example for Slack
- Host: GitHub
- URL: https://github.com/johnagan/triagebot-example
- Owner: johnagan
- License: mit
- Created: 2016-11-06T22:54:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T00:41:33.000Z (over 5 years ago)
- Last Synced: 2025-03-30T09:05:21.937Z (about 1 year ago)
- Language: JavaScript
- Size: 58.6 KB
- Stars: 18
- Watchers: 3
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
:construction: **This repository is no longer being maintained.** :construction:
@slackapi has a similar and more up-to-date :sparkles: version of this app at https://github.com/slackapi/template-triage-bot that uses functionality which predate this one, including Shortcuts, Granular Bot Scopes, and Bolt for Javascript.
---
## What is a Triage Bot? [](https://heroku.com/deploy)
After triggering this bot through a slash command, it will scan the last 1000 messages in the current channel and look for messages that contain certain emojis [[configurable](settings.json#L10)] in the text (not reactions). These messages will be grouped into statuses and reported to the user.
### Statuses
* [Pending](settings.json#L10) - Messages pending review
* [Review](settings.json#L17) - Messages that are in review
* [Addressed](settings.json#L20) - Messages that have been addressed
## Requirements
* A [Slash Command](https://my.slack.com/services/new/slash-commands) setup on your Slack Team
* A [Slack Bot Token](https://my.slack.com/services/new/bot) or a token with at least the `channels:history` scope
## Usage
### Environment Variables
* `TOKEN` - The Slack token
* `PORT` - The webserver port
* `LOCALE` - The preferred locale. Defaults to `en`
### Starting
```shell
TOKEN=xoxp-XXXXXXXXXX PORT=3000 LOCALE=pirate npm start
```
### Contents
* [index.js](index.js) - A very basic webserver and http client to post back to Slack
* [triage.js](triage.js) - The main functionality lies here. Pass in the Slash command payload, the channel history, and optionally any settings overrides. You'll get a formatted Slack message with the results.
### API
```js
let message = triage(
payload, // The payload from the Slack slash command
messages, // An array of slack messages to triage
settings // Any settings overrides to apply [optional]
);
```
### Settings
You can adjust the messages, emoji, and reactjis by updates the [settings.json](settings.json) file or passing in any overrides you'd like to the main function.
```js
triage(payload, messages, {
display: [ "pending", "review" ]
});
```
## Private Response

## Public Response

## Existing Apps
Already have an app and just want the Triage builder? No problem, you could require this package or copy the contents from [triage.js](triage.js).