MM Spotify v1.000

Description

This extension adds the flexibility and controllability of manipulating your Spotify player through commands and/or with the push of a button!

Listeners can submit song requests in chat via artist/song, or they can drop a Spotify link and accomplish the same thing. With this extension, each action is completely independent, meaning you can have your volume automatically adjust when you change scenes, pause the music when you switch to just chatting, or tie a channel point redeem to playing a specific song…the possibilities really are endless!

This extension DOES require a paid Spotify Premium account (couples, student, and family accounts work). Without the premium account, you will only be allowed to fetch your queue, and get the current/previously played songs.

Video Tutorial

Import Code

MM SPOTiFY v1000.4.sb (41.1 KB)

If using another Spotify extension, or earlier versions of this one-ensure you delete ALL actions and commands PRIOR to running !spotifyInit

Obtaining your Spotify Credentials

Go over to the Spotify Developer website and sign in, or create an account. Once you’ve signed in, follow the steps below.

Step 1:

Click your profile in the top right and then on the ‘Dashboard’ drop-down.

Step 2:

Click on the ‘Create App’ button.

Step 3:

The required fields are highlighted in red below. The ‘App Name’ can be whatever you want it to be, and ‘App description’ can be left blank. The ‘Redirect URI’ MUST match this http://127.0.0.1:1400/spotifyAuth/. Lastly, don’t worry about checking any of the boxes, except for agreeing with the terms. Press ‘Save’ and move to the next step.

Step 4:

Press the ‘Settings’ button to be taken to the settings of your newly created app.

Step 5:

Press the ‘Show client secret’ button to expand the field and copy both the ‘Client ID’ and the ‘Client Secret’ to paste into Streamer.bot. Once both are copied, you may close out of your browser.
(Don’t use the Client ID / secret from this screenshot (I’ve already deleted them))

Setting it up

Import into Streamer.bot

Press the Import button on Streamer.bot and drag the previously downloaded file into the ‘Import String’ box. You will be importing 21 Actions, 2 Queues, and 19 Commands.

Press the Import button on the bottom of the ‘Import Actions’ pop out window, and then press the ‘Ok’ button acknowledging the commands are set to ‘Disabled’ by default.

Manually add the References

These next step only apply if you are using Streamer.bot 0.2.2 (or earlier). If you have version 0.2.3 or newer, skip down to ‘Initializing’.

On the ‘Spotify Auto Runner’, ‘Spotify Controls’, and ‘Spotify Initialization’ Actions, you need to double-click on the ‘Execute Code’ Sub-Actions. When they pop open, select the ‘References’ tab and then Right-Click and select ‘Add Reference from file…’.

On the pop-out window, select your Streamer.bot folder and then add each of the following, one at a time:

  • System.Threading.Task.Extensions.dll
  • Newtonsoft.Json.dll
  • Microsoft.Bcl.AsyncInterfaces.dll

After you add the new files, delete the original 3 that were in your folder, press Compile to ensure you get ‘Compiled Successfully’! Once you get that message, you can press ‘Save and Compile’ and then head on over to your chat!

Initializing

Click on the ‘Spotify Initialization’ Action and past your ‘Client ID’ and ‘Client Secret’ that you copied earlier from your Spotify app to it’s respective argument.

Navigate to your ‘Commands’ Tab, right-click on the group name, and ‘Enable All’.

Open up your chat window and run the initialization command: !spotifyInit.

You MUST have the Spotify App open and running on your computer PRIOR to initialization. If not, you’ll have to run the command again!

Upon successful initialization, you will be greeted by this really AWESOME screen and a friendly chat message that has your current PC name listed for Spotify control.

Congratulations, you have just installed MM SPOTiFY v1000!

Commands

All of the commands listed below are NOT case-sensitive and can be changed to your likings for your stream/community. For example, somebody that plays a lot of Marbles on Stream may not want to keep !play.

Command Controllable Feature Description
!play Play/Resume Playback Standard ‘Play’ button for the Spotify App.
!pause Pause Playback Standard ‘Pause’ button for the Spotify App.
!skip Skip the current song Skips the currently playing song.
!previous Skip back to previous song Moves playback to previously played song.
!volume Set the volume of the player Accepts command with numerical values, or argument input (i.e. !volume 70 or !volume -10).
!sr Song Requests Accepts either Artist and Song, or Spotify track links (no playlist, album, or artist).
!song Display the current song Displays the current ‘Song’ by Artist in the chat (even with song names turned off).
!queue Show the current queue If used without a number, it shows the next song. Also accepts values to show next ‘X’ songs (i.e. !queue 5).
!last Show the last played song If used without a number, shows the last song. Also accepts values to show previous ‘X’ songs (i.e. !last 3).
!requesterName Toggle requester names Show requester name with song information. Toggles on/off or can be explicit. (i.e. !requestername on/off, yes/no, true/false)
!songName Toggle song names Shows ‘Song’ by Artist in chat on song change. Toggles on/off or can be explicit. (i.e. !songname on/off, yes/no, true/false)
!link Shows link Displays Spotify link for currently playing song.
!playlist Lists or Selects Playlist Using just !playlist will show user-owned playlist, !playlist # will play that playlist (maintaining queued songs).
!addSong Adds to the playlist Requires selecting playlist first, then !addSong will add the currently playing track to the playlist.
!blockSong Blocks a song from future requests !blockSong will skip the current song and add it to the blocked list. !blockSong with song/artist and/or track link will add it to the blocked list.
!allowSong Removes song from block list !allowSong will show list of all currently blocked songs. !allowSong # or Name from the list will remove it from the blocked list.
!mySongs Shows user’s requests Lists the number in the queue of any user requests.
!spotifyInit Initializes Controls Run after Client ID and Client Secret have been entered.
!spotifyCommands Shows available commands Lists available commands in the chat

!play

Command Aliases: None
Modifiers: None
Notes: It has ONE job…

!pause

Command Aliases: None
Modifiers: None
Notes: Sometimes you just need to pause the music…

!skip

Command Aliases: !next
Modifiers: None
Notes: Who requested that song? Let’s get rid of it…

!previous

Command Aliases: !prev
Modifiers: None
Notes: Maybe that last song was a banger?!

!volume

Command Aliases: !vol
Modifiers: 0-100
Notes: This command accepts an argument %volPercent% (disabled by default and name cannot be changed) for use in other Actions. IF the argument is enabled and you use !volume with no numbers, it’ll set the volume at that value.

!sr

Command Aliases: !request, !songRequest
Modifiers: None
Notes: This accepts either song titles, artist and song titles, or Spotify track links (will send a message in chat telling the requester it can’t accept album, artist, or playlist links).

!song

Command Aliases: None
Modifiers: None
Notes: Even if song names are disabled via the !songNames command, you can manually view the currently playing ‘Song’ by Artist. It will include the requester name if that is enabled!

!queue

Command Aliases: None
Modifiers: 1-50
Notes: If left blank, it will return the next one. When used with a number, it’ll return that many songs (i.e. !queue 5 would return the next 5 songs). If the number of songs requested would exceed the 500 character limit for a Twitch message, it’ll say that in chat instead.

!last

Command Aliases: !lastSong, !lastSongs
Modifiers: 1-50
Notes: Just like the !queue command, if left blank, it will return the last played song. When used with a number, it’ll return that many songs (i.e. !last 3 would return the previously played 3 songs). If the number of songs requested would exceed the 500 character limit for a Twitch message, it’ll say that in chat instead.

!requesterName

Command Aliases: !requesterNames
Modifiers: On/Off, Yes/No, Y/N, True/False
Notes: This can be used as a toggle (i.e. if you type !requesterName and they’re currently on, it will turn them off). Conversely, you can explicitly use one of the modifiers !requesterNames on.

!songName

Command Aliases: !songNames
Modifiers: On/Off, Yes/No, Y/N, True/False
Notes: This only affects the ability to show the ‘Song’ by Artist every time a NEW song plays and operates independently of the !song command. This can be used as a toggle (i.e. if you type !songName and they’re currently on, it will turn them off). Conversely, you can explicitly use one of the modifiers !songNames on.

Global Variables Available

The following global variables are available to be used for things like overlays, GDI text, and Now Playing widgets. Access them like this: ~currentSongName~ throughout Streamer.bot.

Variable Name Description
currentAlbumImage URL of current Album Cover
currentAlbumName Name of Album from currently playing track
currentAlbumTracks Number of tracks on Album associated with currently playing Track
currentArtistName Name of Artist for currently playing Track
currentDurationMs Length of currently playing Track (in milliseconds)
currentProgressMs Progress of currently playing Track (in milliseconds)
currentReleaseYear Release year of Album (or Single) associated with currently playing Track
currentSongLink Spotify link for currently playing Track
currentSongName Name of currently playing Track
currentSpotifyUri Spotify URI for currently playing Track
currentTrackNumber Track number for Album associated with currently playing Track

StreamDeck Buttons

Inspired by Bar Raiders, but created by our very own @fgr_freakon.

SD_Buttons.zip (128.5 KB)

Contributors

MAJOR shoutout to @dagrowlybear, @fgr_freakon, and @Tommy_3621 for testing this thing into oblivion and letting me talk to myself in a group chat for days on end!

5 Likes