Skip to content

chrisdevwords/slack-spotify-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda for Spotify Local Slack Integration

An AWS Lambda to control local Spotify playback via Slack. Includes package script and CircleCI config.

CircleCI Coverage Status Dependency Status Dev Dependency Status Known Vulnerabilities

Clone and run an instance of Spotify Local on a Mac mini and deploy this Lambda with the following Environmental variables:

SPOTIFY_LOCAL_URL=https://xxx.ngrok.io
SLACK_TOKEN=THE_TOKEN_YOUR_SLACK_APP_SENDS_IN_POST_BODY

Requirements

Slash Commands

Add the following commands to your Slack app in order to control an instance of Spotify Local. When adding the slash commands to Slack be sure to point all commands at a POST endpoint for the Lambda's corresponding API Gateway.

What's currently playing?

/playing

Skip the track that's currently playing. Be nice.

/skip

Add a track to the queue.

/add [spotify track id, uri or http link]

Print the list of queued tracks.

/queue

Remove the first track in the queue.

/dequeue 1

Remove all tracks from the queue.

/dequeue all

Get or set the default playlist.

# sets the playlist
/playlist [spotify playlist id, uri or http link]

# gets the playlist
/playlist

Plays a song immediately.

/play [spotify track id, uri or http link]

Toggle shuffle of playlist playback.

/shuffle

Pause the music.

/pause

Resume the music.

/resume

Get or set the volume to a number between 0 and 100.

# sets the volume
/volume 0

# gets the playlist
/volume

Say something funny or useful.

/say [something funny or useful]

Running Tests

This project includes Mocha and Chai. If you add to this, write more tests. And run them:

$ npm test

Contributing

The lint config is based on AirBnB's eslint. To lint the code run:

$ npm run lint

Compiling For Upload

Make sure the bin directory has executable permissions:

$ chmod +x ./bin/build.sh

If this throws an error, trying using sudo:

$ sudo chmod +x .bin/build.sh

Zip up the source code and runtime dependencies for upload by running:

$ npm run build

This should output files.zip to the project root for upload to the AWS Lambda Console.

About

An AWS Lambda to control local Spotify playback via Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published