Skip to content

rjlee/slackreport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SlackReport

A slack bot that adds the option to report a message to a private channel for review.

Setup

The setup of the Slack application, permissions and general approach is outlined at Getting started with Bolt.

The application does require a 'Request URL' to listen to events (e.g. when a message is reported). This is an external endpoint that Slack can send event notifications to, during local deveopment this can be achieved using 'ngrok' - see tunneling with ngrok.

Application Setup

Create a slack app

Image of App Setup

Action Setup

Visit 'Interactive Components' and add an action:

Image of Action Setup

Configuration

The app can be configured by either environment variables and/or a configuration file

export SLACKREPORT_SIGNING_SECRET=...
export SLACKREPORT_BOT_TOKEN=xoxb-...
export SLACKREPORT_REPORT_CHANNEL=reports
{
"SLACKREPORT_REPORT_MESSAGE_TEXT": "<@${body.user.id}> reported message '${payload.message.text}' from <@${payload.message.user}> in channel <#${payload.channel.id}>",
"SLACKREPORT_ACKNOWLEDGE_MESSAGE_TEXT": "The message was successfully reported, we will review the message and contact you if any further information is required."
}

Running

npm install
node app.js

Debugging

To aid debugging, the logLevel can be increased:

const app = new App({
  token: process.env.SLACKREPORT_BOT_TOKEN,
  signingSecret: process.env.SLACKREPORT_SIGNING_SECRET,
  logLevel: LogLevel.DEBUG
});

About

A slack bot that adds the option to report a message to a private channel for review.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published