Giter Club home page Giter Club logo

twitch-spotify-request-bot's Introduction

Twitch Spotify Request Bot

What is this?

This is a bot that listens to the chat of a given Twitch stream for messages with a Spotify song link in them and then adds that song to a playlist and/or your queue. The Spotify link must be at the start of the message in order to be picked up.

✔️ Message that WOULD be picked up:

https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC?si=x-_FFgqBRB20mzW_lM7kDQ pls play this, it's a bop

❌ Message that WOULD NOT be picked up:

this is a bop can you please play this https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC?si=x-_FFgqBRB20mzW_lM7kDQ

Prerequisites

  • Some basic programming knowledge (running terminal commands and editing JSON files)
  • Node (developed and tested on 14.6.0 - your mileage may vary on other versions)
  • Yarn (NPM does not work)
  • A Spotify account

Setup

  • Go to the Spotify developer dashboard and create a new application. The app can have whatever name and description you want
  • Once the app is created, click on Edit Settings and add a redirect URL of http://localhost:8000/spotifyAuth (NB: the port will be whatever you have set as the AUTH_SERVER_PORT in the config.json file, by default it is 8000)
  • Run yarn
  • Create a src/config.json file based on src/config.json.template file and fill in the fields
    • The playlist ID can be found by right clicking on the playlist -> clicking Share -> Copy Spotify URI and then copying the ID after spotify:playlist: eg. spotify:playlist:{THIS_STRING_IS_THE_ID})
    • The Spotify client ID and secret are obtained from the application you created in the Spotify developer dashboard
  • Run yarn start in the root directory of the project
  • Open the authorization link and give the app the required permissions
  • If you have ADD_TO_QUEUE toggled on, ensure you have the Spotify client open and that it is active (i.e. is playing a song)
  • Type a Spotify link in the chat (ensuring the link is the first piece of text in the message) and make sure it shows up in your desired playlist (Spotify links should start with https://open.spotify.com/track/)
  • If there's a problem with Spotify authorization at any point, try deleting the spotify-auth-store.json file and starting the app again

Open Source Libraries Used

Used for connecting to and performing actions using Spotify

MIT License

Used for connecting to Twitch chat

MIT License

Used for creating a temporary local web server to retrieve the callback from the Spotify authorization

MIT License

Used to speed up development with hot reload

MIT License

Used to make code pretty

MIT License

Used to run TypeScript

MIT License

Used for strong typings

Apache 2.0 License

twitch-spotify-request-bot's People

Contributors

marcdonald avatar trithir avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.