kandi X-RAY | discord-rpc Summary
kandi X-RAY | discord-rpc Summary
discord-rpc
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of discord-rpc
discord-rpc Key Features
discord-rpc Examples and Code Snippets
Community Discussions
Trending Discussions on discord-rpc
QUESTION
I had a issue with my app shutting down when discord wasn't launched on desktop because of RPC.
...ANSWER
Answered 2021-Sep-16 at 01:39Now when I added the catch block it doesn't shut down when it cannot connect but it shows a pretty long error to the user, which I would like to hide or replace with a smaller console log like "RPC offline" or something
You mean you want to do something like .catch(() => console.log("RPC Offline"))
?
ofcourse i tried to use normal
try-catch
and only .catch(error) instead of.catch(console.error)
but that doesn't seem to catch the unsuccessful connection and just shuts down the script again.
Because it's a promise and you can't handle rejections via try-catch
unless you are await
ing
QUESTION
I'm only importing discord-rpc and only have main.ts
. Also using rollup plugins typscript and node-resolve.
main.ts
import:
ANSWER
Answered 2020-Nov-06 at 17:26Ok so I solved the problem!
I had to move a few things around:
rollup.config.js
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install discord-rpc
Download the DLLs for any platform that you need from our releases
In your Unity project, create a Plugins folder inside your Assets folder if you don't already have one
Copy the file DiscordRpc.cs from here into your Assets folder. This is basically your header file for the SDK
Create x86 and x86_64 folders inside Assets/Plugins/
Copy discord-rpc-win/win64-dynamic/bin/discord-rpc.dll to Assets/Plugins/x86_64/
Copy discord-rpc-win/win32-dynamic/bin/discord-rpc.dll to Assets/Plugins/x86/
Click on both DLLs and make sure they are targetting the correct architectures in the Unity editor properties pane
Done!
Copy discord-rpc-osx/osx-dynamic/lib/libdiscord-rpc.dylib to Assets/Plugins/
Rename libdiscord-rpc.dylib to discord-rpc.bundle
Done!
Copy discord-rpc-linux/linux-dynamic-lib/libdiscord-rpc.so to Assets/Plugins/
Done!
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page