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_ID
SPOTIFY_CLIENT_SECRET
SPOTIFY_REFRESH_TOKEN
TWITCH_USER
TWITCH_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 setup
to install and setup dependencies - Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
- Start without phoenix with
mix run --no-halt
or 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