GithubHelp home page GithubHelp logo

lapras-inc / slack-rage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from h3poteto/slack-rage

0.0 0.0 0.0 321 KB

Slack bot to notify excited channels using Event API

License: MIT License

Go 98.59% Dockerfile 1.41%

slack-rage's Introduction

Docker Pulls GitHub release (latest SemVer)

SlackRage

SlackRage is a Slack bot. It will monitor all messages in participating channels and detects conversational excitement on these channels. It will notify the channel when excitement is detected. This command line tool provides two methods to monitor Slack channels. First one is using RTM, and another one is using Slack Event API.

Usage

$ ./slack-rage --help
Notify the rage of slack channel

Usage:
  slack-rage [command]

Available Commands:
  event       Run webhook server for slack Event API
  help        Help about any command
  rtm         Run bot using Real Time Message
  version     Print the version number

Flags:
  -h, --help   help for slack-rage

If you want to use RTM, please provide argument:

$ ./slack-rage rtm --help
Run bot using Real Time Message

Usage:
  slack-rage rtm [flags]

Flags:
  -c, --channel string   Notify channel. (default random)
  -h, --help             help for rtm
  -p, --period int       Observation period seconds for rage judgement. This CLI notify when there are more than threshold posts per period. (default 60)
  -t, --threshold int    Threshold for rage judgement. (default 10)
  -v, --verbose          Enable verbose mode
  • channel Please specify Slack channel name which you want to be notified.
  • period Observation period seconds.
  • threshold This CLI notify when there are more than threshold posts per period in a channel.

And event command requires same arguments.

Setup

You can run this CLI with docker, and start bot using RTM as default.

$ docker run --rm h3poteto/slack-rage ./slack-rage rtm

RTM

New Slack App does not support RTM, so please create Classic Slack App.

New Slack apps may not use any Real Time Messaging API method. Create a classic app and use the V1 Oauth flow to use RTM.

After you create a Classic app, you can get OAuth Access Token and Bot User OAuth Access Token. Please set these token to environment variables.

$ docker run --rm -e SLACK_TOKEN={BotUserOAuthAccessToken} -e OAUTH_TOKEN=${OAuthAccessToken} h3poteto/slack-rage

And please provide these scopes to the app.

  • bot
  • channels:history
  • channels:read
  • chat:write:bot
  • user:read

rtm-scopes

Everything ok, please invite this bot user to Slack channels which you want to monitor.

Event API

Please create a new Slack App, and you can get Bot User OAuth Access Token. Please set this token to environment variables.

$ docker run --rm -e SLACK_TOKEN={BotUserOAuthAccessToken} h3poteto/slack-rage event

You have to prepare Web server to receive webhook from Slack Event API. So please run this docker image in your server, and assign DNS, like slack-rage.example.com. Please set it to RequestURL in Event Subscriptions, add message.channels event to subscribe to bot events, and enable Events.

event-subscription

Please provide these scopes to the app.

  • channels:history
  • channels:read
  • chat:write
  • users:read

event-scopes

Everything ok, please invite this bot user to Slack channels which you want to monitor.

License

The package is available as open source under the terms of the MIT License.

slack-rage's People

Contributors

h3poteto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.