Plays music using Spotify or YouTube, requested from Twitch chat.
These instructions will show you how to install and use the bot.
First, download the .exe on the releases-page. Double-click it and follow the installer instructions. In this version, you will have to create a settings.json. You can also provide a secrets.json if you want to use a custom account for the Songrequestbot. Additionally, you can start Spotify either in a browser or the application.
Now you can execute the program using the exe inside the installation folder and should see a window with a YouTube player which will play YouTube videos and the Spotify player is used to play Spotify songs after you have logged in as the alert will tell you.
Location: home/Songrequestbot/secrets.json
{
"twitch": {
"client-id": "CLIENT_ID_OF_APPLICATION",
"password": "PASSWORD_OF_APPLICATION"
}
}
For more information about what client-id and password mean, see secrets.json (in deployment)
Note: For now, there is no installer for Linux and macOS and you will have to deploy the bot. You may test it with wine but this is not explicitly supported and may not work at all or lead to bugs
- Go to the releases-page, download the newest release as a
.zip
-file and unpack it in an empty folder. - Then you will have to manually install the node_modules:
cd "path/to/the/folder/where/you/unpacked/the/zip" npm install
Now you have to create two files.
Location: home/Songrequestbot/settings.json
{
"twitch": {
"username": "YOUR_TWITCH_USERNAME"
},
"commands": {
"COMMAND": [
]
},
"disabled": {
"services": [
]
},
"properties": {
"skip": {
"viewers": "25%"
}
},
"limitations": {
"length": 0,
"requests": 0
},
"reduced-debugging": false
}
Notes:
- The
COMMAND
array is being used to define the commands users will have to use in order to trigger the commands. For example, you could write:The keys for the commands are"songrequest": [ "sr", "songrequest" ]
songrequest
,forceskip
,skip
,wrongsong
andcurrentsong
; if you do not provide a command in the settings, those keys will be used as default triggers. If the array is empty, the command will be disabled. - The
disabled
object is currently being used to disable services. Inside the services you can either insert"spotify"
or"youtube"
. - The
reduced-debugging
boolean is being used to control whether the bot should write complete messages with detailed info or only error codes. - In
properties -> skip -> viewers
you can define how many viewers will have to type in!skip
(by default) in order to skip the song. You can either typeNUMBER
(absolute value, example:12
) orNUMBER%
(relative value, example:12%
). If you do not provide this setting, the default (25%
) will be used. limitations -> length
determines how long (in minutes) a track can be. If no value is provided or the value is0
, the track's length is unlimited.limitations -> requests
determines how many songs of a viewer can be in the queue at the same time
Location: The folder where you unpacked the zip
{
"spotify": {
"id": "YOUR_ID",
"secret": "YOUR_SECRET"
},
"twitch": {
"client-id": "CLIENT_ID_OF_APPLICATION",
"password": "PASSWORD_OF_APPLICATION"
},
"youtube": {
"key": "YOUTUBE_KEY"
}
}
Now you will have to create some applications:
- Create a Spotify application
- Create a Twitch application:
Head to your Twitch application dashboard and click onRegister Your Application
. The name can be whatever you want (I would recommendsongrequestbot
) and as OAuth Redirect URL enter the value you get from the Twitch Chat Password Generator. Afterward, selectChat Bot
as category and click on create. Enter the OAuth Redirect URL in the json atPASSWORD_OF_APPLICATION
and the Client ID asCLIENT_ID_OF_APPLICATION
- Create a YouTube application:
- Create a new project with the YouTube Data API v3 in your Google API Console
- On the Add credentials to your project page, click the Cancel button.
- At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.
- Select the Credentials tab, click the Create credentials button and select API key.
- Copy the API key and paste it into the json file at
YOUTUBE_KEY
Since the program is currently in alpha, you have to run the program via the command prompt.
- Windows:
cd "path/to/the/folder/where/you/unpacked/the/zip" node_modules/electron/dist/electron.exe index.js
- Unix (only tested on Linux but on macOS it should work the same way):
cd "path/to/the/folder/where/you/unpacked/the/zip" node_modules/.bin/electron index.js
- Error code 1: The song could not be played due to restrictions. Please open the following link in a browser in order to play the song and afterward dismiss the alert in the electron window
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Trojaner - Initial work - TrojanerHD
See also the list of contributors who participated in this project.
In a future update it is planned that you can run the application without having to log in to Spotify. If you do not, links from Spotify will be not accepted and the bot will only use YouTube for search queries.