XFG16 / YouTubeDiscordPresence

An extension that takes data directly from the YouTube video playing on the browser and displays it as a rich presence on Discord. Works similar to the Spotify Discord rich presence.
https://chrome.google.com/webstore/detail/youtubediscordpresence/hnmeidgkfcbpjjjpmjmpehjdljlaeaaa
MIT License
121 stars 6 forks source link

YTDP presence for all open Discord instances #25

Closed charleskimbac closed 2 months ago

charleskimbac commented 4 months ago

It'd be nice if YTDP showed a presence for all open Discord instances (stable, PTB, & canary).
Right now I have stable and PTB open and the presence only shows for the first instance that's opened.

XFG16 commented 2 months ago

Hey, sorry for the late response! Could you provide some more details on this issue? I don't know how Discord.js works, but it might only be able to connect to one websocket (Discord instance) at a time. Is there a reason why you need to have multiple opened at the same time?

charleskimbac commented 2 months ago

I just use 2 discord instances with different accounts and it'd be nice if they both had the presence. No clue how things in the backend work though.

XFG16 commented 2 months ago

I see!

How it works on the backend is that the Node.js process creates a Discord socket connection to send the presence from Chrome to Discord. The socket only connects to one client at a time, so that's why it can only update one at a time. I'm not sure if I would be able to work a solution out, because I feel this use case is relatively niche and this application is designed for the average person who uses one account at a time.

However, if you do want support, I'd suggest you clone the code and make it so that multiple connections are made at a time instead of one.