Handle Discord rich presence,Discord Rich presence when discord isn't installed

I added Discord rich presence to a game of mine, and it works. The problem is, when I try to run it on a computer that doesn’t have Discord, windows tells me “you’ll need a new app to open this discord link.” Is there a way to check if Discord is running or to just not get this warning to show up?,I added Discord rich presence to my game, and it works fine. When I opened the game on a PC without discord installed, Windows says “You’ll need a new you’ll need a new app to open this Discord link.” Is there a way to check if Discord is open before creating rich presence so this doesn’t happen?

I figured out how to do this. You can check if discord is running using this code:

            bool discordRunning = false;
            // loops through open processes
            for (int i = 0; i < System.Diagnostics.Process.GetProcesses().Length; i++)
            {
                // checks if current process is discord
                if (System.Diagnostics.Process.GetProcesses()*.ToString() == "System.Diagnostics.Process (Discord)")*

{
discordRunning = true;
break;
}
}
You can then only initiate rich presence if Discord if discordRunning is true.
If you want to make sure the game doesnt crash if Discord is opened and closed during the game, just make sure you check discord is running before you ever initiate or edit rich presence.