/slack-mini-games

:video_game: A collection of mini games for your slack team.

Primary LanguageJavaScript

slack-mini-games

A collection of mini games for your slack team.

List of games

  • Roller: roll between the numbers, the person with highest number wins.
  • Rock Paper Scissors

Possibly more (suggestions are welcome!)

Setting up

  1. Setup the Slash Command Token(s) and Webhook URL. (Look at point 3 and 4 further below.)

You can either set these in config.js file under config directory or you can use ENV variables which is a better way of doing it. Using ENV variables on heroku:

`heroku config:set WEBHOOK_URL=[YOUR_WEBHOOK_URL]`  

**Note:** Depending on the games you will need to add separate ENV variables for each slash command token.  
`heroku config:set ROLLER_TOKEN=[YOUR_ROLLER_TOKEN]`  
`heroku config:set RPS_TOKEN=[YOUR_RPS_TOKEN]`
  1. Deploy the node.js application (I'm using heroku here.)

There is a nice tutorial on deploying to heroku here.

  1. Add a new Incoming Webhook integration to your slack team:

Choose a channel to post messages to. (This doesn't matter, it will always post back to the channel that the slack command is called from.)

Grab your Webhook URL from this page.

  1. Add a new Slash Command integration to your slack team:

Note: Depending on the games you might need to add multiple slash commands.

Roller

  • Command: roll
  • URL: http://DEPLOYED_APP_URL/roll
  • Method: POST
  • Description: roll a number

Rock Paper Scissors

  • Command: rps
  • URL: http://DEPLOYED_APP_URL/rps
  • Method: POST
  • Description: Rock Paper Scissors!

Grab your slash command token from this page.