CrossPlatformPlaying icon indicating copy to clipboard operation
CrossPlatformPlaying copied to clipboard

Work with new discord version

Open giorgi-o opened this issue 2 years ago • 9 comments

This uses a custom preload script to inject into discord's main process and expose some custom functions for opening net/tls sockets, therefore working almost like before the update.

I say almost, because some extra setup is required to get it working:

  • Go to %localappdata%/Discord/App-1.0.XXXX/resources/app
  • put CPP_preload.js in that folder, next to index.js
  • Open index.js, and above the require(...\\BetterDiscord.asar) line, paste everything in add_this_to_index.js
  • Close Discord with Alt+F4 (Ctrl+R isn't enough)

Once you reopen Discord, you can install the beta version of the plugin as usual in the plugins folder.

The short term plan is to automate this process, so that it happens in one click when you first install the plugin.
The long term plan is to try and get the net/tls wrappers integrated into BetterDiscord itself, to not need to do this setup at all.

Let me know if anything doesn't work, either by opening a new issue or replying to this PR :)

giorgi-o avatar Nov 03 '22 23:11 giorgi-o

Getting a TypeError: Cannot read property 'children' of undefined) image

image

ZeddPerm avatar Nov 20 '22 05:11 ZeddPerm

Yup, seems to happen when you open the settings panel. It's a bug with ZeresPluginLibrary, so we gotta wait for them to fix it.

In the meantime you can always edit CrossPlatformPlaying.config.json directly if you need to.

giorgi-o avatar Nov 20 '22 09:11 giorgi-o

I'm getting a different error when trying to open the settings panel now. image

ZeddPerm avatar Nov 30 '22 05:11 ZeddPerm

Yup, seems to happen when you open the settings panel. It's a bug with ZeresPluginLibrary, so we gotta wait for them to fix it.

In the meantime you can always edit CrossPlatformPlaying.config.json directly if you need to.

Could you elaborate on what the exact issue with ZeresPluginLibrary is? I would like to open an issue about it in their github repo. Or you can open the issue yourself.

ZeddPerm avatar Dec 01 '22 06:12 ZeddPerm

Whenever I add the contents of add_this_to_index.js to index.js and Alt+F4 Discord, Discord doesn't re-open until I revert the changes to index.js

Please help!

JustinsKittens avatar Dec 05 '22 23:12 JustinsKittens

Instead of going to %localappdata%/Discord/App-1.0.XXXX/resources/app go to %localappdata%/Discord/App-1.0.XXXX/modules/discord_desktop_core-1/discord_desktop_core and then proceed with the rest of the steps.

Bamboozul avatar Dec 14 '22 13:12 Bamboozul

Hi, is this plugin still being updated?

Cloakster0 avatar Jul 06 '23 04:07 Cloakster0

I do not see any file or anything named app under resources. Might just be on my side but would appreciate any help

CHICKENMAN1128 avatar Jan 09 '24 23:01 CHICKENMAN1128

i was gonna ask if the rich presence feature support is implemented, or will it be implemented later?

KfkFod avatar Jun 12 '24 12:06 KfkFod