An example of using :twitch_chat to make a bot that adds songs to your spotify queue.
You need to set the following environment variables:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRETSPOTIFY_REFRESH_TOKENTWITCH_USERTWITCH_OAUTH_TOKEN
To get the spotify token, you can use https://github.com/alecchendev/spotify-refresh-token.
You need user-modify-playback-state scope to add songs to the queue.
To get the twitch oauth token, you can use https://twitchapps.com/tmi/
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server - Start without phoenix with
mix run --no-haltor inside IEx withiex -S mix
Edit this file
If you need to tweak any of the song queue stuff, it's here:
- Start the bot after it's set up.
- Use the command in your channel like this:
!spotify add https://open.spotify.com/track/0sUuhbkGnJk6ZjSQJmZY9d?si=3ec1fcbd64364bb2
!spotify song