Collaborative playlists in Slack
Refrain is an open source, host-it-yourself clone of Jukebot. It allows you to share your Spotify account with your office and your taste in music with one another, for better or for worse.
|Command||Must be "on"||Description|
||No||Add given playlist|
||No||Become active user|
||Yes||Remove playing track from active playlist|
||Yes||Search for music|
||No||Show your playlists|
||No||Show authenticated users|
||Yes||Set shuffle state|
||No||Get Spotify auth link|
||No||Show active playlist|
||No||Show active user|
||Yes||Show current track info|
The command names have been chosen to avoid conflicts with the Jukebot slash commands so that you can trial them side-by-side.
You will need:
- a server to host Refrain on
- a MongoDB cluster
- a Spotify developer account
- Clone this repository on your server and create a
.envfile in its directory. Add your server's address and your database address like so:
- Head over to your Slack apps and click Create New App. Give it a name and attach it to your workspace.
- In OAuth & Permissions, select the scopes Add commands to my workspace
and Send messages as Refrain. Hit the big green install button at the top
of the page, then copy your OAuth access token and add it to your
- In Slash Commands, add each of the commands in the table above. The
request URL is
http://your.server.domain/commandfor all of them.
- In Interactive Components, click Enable Interactive Components and put
http://your.server.domain/interactivein the Request URL field, then click the big green button.
- On the Spotify developer site, click Create an app and go through the
setup. Copy your client ID and client secret into your
- On the Spotify developer site, click Edit settings and add
http://your.server.domain/callback. Hit Save at the bottom.
- Fire up Refrain on your server. You can use pm2
(recommended) or just
- Improved playlist handling: let users know when Spotify has veered off into another playlist, as this causes the most API errors
- Alias all slash commands to /refrain to reduce the tedium of setup
- Volume control
- Handle Spotify API timeouts
- Thanks to the Jukebot team for inspiring this project
- Thanks to Ben Tyrer for the name suggestion