Skip to content

AnanasPizza/AnanasMusicBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnanasMusicBot

Open Source (CC BY-NC 4.0 DEED) Twitch Spotify Bot, by twitch.tv/ananasxpress_

AnanasMusicBot allows Twitch-Streamers to enable Spotify Songrequests via Channelpoints, by hosting this project. Viewers can also get informations about the current, previous and upcoming songs. Moderators can skip songs or change the volume. There is no additional cost, except from hosting a webserver that can run a NodeJS App, that supports https and certificates.

If you need help, hosting this on your server, you can always contact me.

Prerequisites

  • Insomnia REST Caller (https://insomnia.rest/download)
  • Server with nodejs installed
  • Set up a MySQL-Database
    • Execute the setup.sql to create the initial database structure
  • Create Spotify-App
  • Create a Twitch Account, that is your actual Chat-Bot
  • Create Twitch App
  • Setup your webserver, so that it can host a https Webserver, therefore you need to get a certificate
    • Create a folder "certs"
    • Add certificate and key as "cert.pem" and "key.pem" to the folder.
  • Create a file '.env', copy everything from .example.env and fill in the values as described in the placeholders.

Once this is done, you need to create the connection between your Bot Account and the Twitch App and allow the Bot to reauthenticate itself

On the next start, the bot should automatically get a new token and persist it.

Installation

npm install
npm install -g forever
forever start index.js

Usage

To finally use the bot, start it and then visit YOUR_BASE_URL/start

First connect your Twitch Account and give the bot access to the requested scopes. Then fill in your Twitch ID and Username. You will be redirected back to the start and can click on Connect to Spotify. Give the Spotify App Access to your account The Bot should then join your channel and write a message that it is there. Type !srcommands to check that it works and see all available commands.

If you want to give others the opportunity to use your instance, they have to follow the steps to connect their account and also they need to give you their email address, so that you can add them in the Spotify Developer Console. There is a limited space of 25 Users in the Development Mode of a Spotify App.

License

CC BY-NC 4.0 DEED