MundialBot⚽️ is a Slack bot for distributed teams watching the WorldCup
You know that moment when somebody mentions you on Slack while you are watching your team playing at the WorldCup, you try to keep watching the game while answering the message with your phone just to miss an important play.
MundialBot⚽️ solves it by looking at your timezone to guess your country and looks if your national team is playing, if so it automatically answers the mention with something similar to this:
@cherta is watching Uruguay, he'll probably respond after the game ends.
Here's a step by step to roll out your own MundialBot⚽️
$> git clone git@github.com:ingsw-dev/mundialbot.git
$> cd mundialbot
The easiest way to install it is to deploy the app to Heroku, for that you just need to have the heroku-cli
, create a new app and add the heroku origin.
Create a new app on Heroku, then configure the Heroku remote.
$> heroku git:remote -a app-name`
$> git push heroku master`
Slack apps are a complex beast, you have a tons of options, this is what you need to do:
- Create a new slack app selecting a name and a workspace
- Under the "Add features and functionality" menu select the "Event Subscriptions" option
- Add the
message.channel
to you "Workspace Events", if you also want to be notified of messages on private channels also add themessage.groups
event as well - Go back to the "Event Basic Info" and select Bot under the "Add features and functionality". Create the Bot and name it
- Go back to the "Event Basic Info" and select "Permissions" under the "Add features and functionality". Copy both API Keys, the first one is the
EVENT_TOKEN
on Heroku config vars and the last one is theSLACK_TOKEN
- Change your config vars on your Heroku app
To verify your slack app to receive events from slack you need to got to "Event Subscriptions" and set the Request url to something like https://app-name.herokuapp.com/slack/events
. This will fail, don't worry, go to your terminal and type heroku run npm run verify -a app-name
and start your app on Heroku, this will start a server that will respond to the slack verification, try veryfing again, this time it should work.