Skip to content

Instantly share code, notes, and snippets.

@ezeholz
Last active April 16, 2024 19:50
Show Gist options
  • Save ezeholz/c148d67dc4e9ed64c8b513c5556777f0 to your computer and use it in GitHub Desktop.
Save ezeholz/c148d67dc4e9ed64c8b513c5556777f0 to your computer and use it in GitHub Desktop.
Discord Play Along

Discord Play Along with Free Account!

This is the code for those people who wanna listen with friends, but don't have a premium account.

Usage

All you have to do is go to your friend's profile, press CTRL + SHIFT + I, go to console and paste the following code:

setInterval(() => {
  document.getElementsByClassName('tabBar-2hXqzU')[0].children[1].click()
  document.getElementsByClassName('button-2IFFQ4')[0].click();
}, 1000);

And let the profile popup open. I recommend opening it in a browser, and not in the app, so you can keep using it despite using this trick.

Explanation

Now, I'll start getting technical because of the warning message from Discord itself: Warning

I know, you're probably reading this and thinking "This person is scamming me" Well, for those people, I'm gonna explain step by step what is this code doing, and why you don't have anything to be afraid of.

Arriving to the solution

First of all, you should know that listen along is not possible without a premium account. But you can actually play song by song from your friend's profile. So this script is just doing it automatically. spotify

The button of "Play on Spotify" has some unique ID's, between them there is the one called button-2IFFQ4 We're gonna take that ID, and click the button but inside the console of Discord. That command is:

document.getElementsByClassName('button-2IFFQ4')[0].click()

Making that, you can actually use it to click a button with a command, but you need to do it automatically. You'll only need to add the following part to solve that, we're gonna make that it executes the command every 1 second, so there's no call-spam:

setInterval(() => {
  document.getElementsByClassName('button-2IFFQ4')[0].click();
}, 1000);

And that's it, now the code it's gonna execute itself every second, so you don't have to worry about sync issues.

UPDATE: Thanks to Discord, we now should add the following code before even reach the spotify button:

document.getElementsByClassName('tabBar-2hXqzU')[0].children[1].click()

That just selects the Activity tab inside every Discord profile. In case somebody pause their music for a second and the tab disappear. image

@ezeholz
Copy link
Author

ezeholz commented Jun 7, 2022

setInterval(() => { document.getElementsByClassName('button-TGAkj4')[0].click(); }, 1000); works for when you're simply hovering over someone's profile.

You should hover the profile, and then click the view profile button on the profile pic. Then in activity you should see the Play on Spotify button.
image

I recommend doing it in a browser, because you're not gonna be able to use the client while you're listening.

@Nataliepongg
Copy link

setInterval(() => { document.getElementsByClassName('button-TGAkj4')[0].click(); }, 1000); works for when you're simply hovering over someone's profile.

You should hover the profile, and then click the view profile button on the profile pic. Then in activity you should see the Play on Spotify button. image

I recommend doing it in a browser, because you're not gonna be able to use the client while you're listening.

this is great, love ur new update as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment