Skip to content

Installation

Henrik Tilly edited this page Oct 12, 2016 · 6 revisions

Installation

In order to get the bot up and running you need to do the following.

##Pre-requisit:

1: #Slack-group with admin rights

2: A server / machine that can run node.js

3: A working Sonos player configured with Spotify

3a: You need to know the IP of your Sonos player.

#Slack

Create a bot in #Slack.

You need to give it a name, and write down the API Token. You will need this in your setting file later.

Hit "Save Integration" and you are done in #Slack.

Optional you can give the bot some nice namne, icon etc.

Node.js - Zenmusic!

This guide assume you have git, node.js and NPM installed, and running linux =)

Change to "/opt"

cd /opt

Clone this repository

git clone https://github.com/htilly/zenmusic.git

Enter the new directory, zenmusic

cd zenmusic

Type

npm install

Almost there... some simple configuration first.

config.json

Copy the example config to your own config file.

cp config.json.example config.json

Edit config.json with your favorit text editor.

Replace:

"music-admin" - with the #slack channel you want the bot to respond to admin commands.`

"music" - with the #slack channel you want the bot to be a DJ in =)`

"IP_TO_SONOS" - with the (static) IP of you sonos player / controller.`

"SLACK:TOKEN" - with the token you got for the bot in "Slack.`

"US" - with the country that you use Spotify.

75 - with the maximum volume you can set the Sonos to via "setvolume" in #Slack

And last thing... start the bot!

node index.js

You should see something like:

[Sat Apr 30 2016 21:44:10 GMT+0200 (CEST)] INFO Connecting... Welcome to Slack. You are @zenmusicbot of Schibsted Media Group You are in: #music As well as: music-admin

Clone this wiki locally