How to check if discord is open?

I’m trying to add discord rich presence in my game, but as many may know, trying to use rich presence when discord isnt open crashes the game/editor and opens discord.

My work around this has been using System.Diagnostics.Process.GetProcesses() to check if discord is open and running(by checking each value and seeing if they’re equal to “System.Diagnostics.Process (Discord)”)

The issue is, when within the editor(On windows) it works fine, but outside of the editor, it doesn’t seem to, and I don’t know why(I tried writting to a file the output of it once built for windows, and the text file comes out empty). Does anyone know how to fix this? or an alternative way to check if discord is running?

Does their documentation have anything about detecting online presence? It seems likely they would…

The issue is not on discord’s side, judging by my testing(if I remove the process check, it works just fine). The issue seems to be related to System.Diagnostics.Process not working outside of the SDK for some reason

This is an IL2CPP limitation:

1 Like

I find it pathetic that, after YEARS, they’ve yet to implement something so useful and probably commonly used.