Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates and Fixes issues with Discord Rich Presences #3785

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alipoodle
Copy link
Contributor

@Alipoodle Alipoodle commented Jan 26, 2020

My system and some pre information

Note I've had to disable the pre-commit as it simply would not run no matter what the debugging I tried on it
But info:
node -v : v8.15.0
npm -v: v6.4.1
This was Tested on a Win10 64x (1903)

npm run lint has been ran, and no errors returned.

Fixes:

Possible fix to #2969
This issue seemed to be caused by a dead RPC connection when Discord wasn't open, still trying to send requests to it. This is fixed by using a Connected / Disconnected varaible which prevents from sending requests to nothing.
This is not verified as I was not experiancing the issue before, but from my testing of a few hours on my PC, (On and Off Discord) My RAM never really exceeded much 300MBs.

Fixes #3266
This is fixed by using my own Discord application instead of the currently used one. I've previously requested to join the existing Application but haven't got a reply. I have this one setup for teams already, and willing to add people if I'm provided with a Discord username + Discrim. (Discord only supports Full Admin at the moment so it will be restricted to main Contributers, People who have got previously approve Discord RPC work)

Fixes #3404
This will currently try to reconnect to the client on a State change but the Event listeners on Google Play Music might get moved around.

Explaination stuff...

Looking through the Basic Discord-rich-presences library used before, there was no event triggered for disconnecting from client.
This is why I have instead replace it with the native discord-rpc library instead of the wrapper library originally used, for better control over the RPC + all of the events including the Disconnect.

Added features

I've also added an additional feature of showing a Heart icon on songs which are liked.
Heart icon example

Testing

Sadly this can't have a testing Library but I will create YouTube Video including a showing example of it all working!

Crappy YouTube Video showing "stuff"

Edit:
Been rolling with this as my Daily driver for my Google Play Music, and a friend of mine has been using the prebuilt version for their daily driver for a few weeks, with no issues towards it showing up incorrectly.

Discussion

One thing that probably needs a bit more questioning would be the usage of the Application's event listeners and for when to check for a connection for Discord.


This change is Reviewable

Possible fix to MarshallOfSound#2969
This issue was caused by a dead RPC connection when Discord wasn't open, still trying to send requests to it.

Fixes MarshallOfSound#3266
This is fixed by using my own Discord application instead of the currently used one. I've previously requested to join the Team for the existing one but haven't got a reply. I have this one setup for teams already, and willing to add people if I'm provided with a Discord username + Discrim.

Fixes MarshallOfSound#3404
A connect + disconnect event were needed to be able to check if the client was actually connected and when to check for reconnections for this.

Looking through the Basic Discord-rich-presneces library used before, there was no event triggered for disconnecting from client.
This is why I have instead replace it with the native discord-rpc library instead of the wrapper library originally used, for better control over the RPC + all of the events including the Disconnect.

I've also added an additional feature of showing a Heart icon on songs which are liked.
@EnchantedLeaves
Copy link

Thank you.

@krazyito65
Copy link

can we get these changes merged? i would love to have presence working again

@Sxtanna
Copy link

Sxtanna commented Dec 15, 2020

@MarshallOfSound Can this be merged? It's getting pretty old... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DRPI stops working after Discord restart Discord Rich Presences uses old logo
6 participants