- Go to
https://SLACKDOMAIN.slack.com/services
- Find Incoming WebHooks and click it
- Click the green "Add" button
- Choose the channel you want to announce to when someone plays a sound, then click Add Incoming WebHooks Integration
- Copy the Webhook URL down somewhere, you'll need it later.
- Go back to "All Integrations" page
- Find Slash Commands and click it
- Click the green "Add" button (it's at the bottom this time)
- From the "Outgoing Data" section, copy the value of the
token
- Clone the repo on your Pi
- Create a
.env
file in the project root - Add the following environment variables
SLACK_HOOK_URL
- the webhook URLSLACK_HOOK_TOKEN
- the slash command token
npm install
sudo apt-get install mpg123
forever start app.js
I recommend using a service like ngrok on the Raspberry Pi to get a dedicated subdomain for the application. Once you have this set up, you can finish configuring your slash command with the URL where the app is accessible. Note that the endpoint will be /play
- Put the mp3 file in the sounds directory
- Open
sounds.json
in your editor - Add a new object to the array of sounds, the
trigger
is the text passed after your slash command and thefilename
is the name of the mp3 file (relative to the sounds directory).