From 5e23c2a95efccae316676b86b34816addd624809 Mon Sep 17 00:00:00 2001 From: Plextora <71889427+Plextora@users.noreply.github.com> Date: Wed, 28 Dec 2022 21:08:31 -0500 Subject: [PATCH] Discord Presence will now get cleared if Kaikki cannot get focused process --- DiscordPresence.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DiscordPresence.cs b/DiscordPresence.cs index 98a4118..0ecb8e4 100644 --- a/DiscordPresence.cs +++ b/DiscordPresence.cs @@ -118,6 +118,12 @@ public static string RunDiscordRpc(string procName) return "User is focused on the Kaikki window. Clearing presence..."; } + if (procName == "Unknown") + { + Client.ClearPresence(); + return "Cannot get the process name of focused window. Clearing presence..."; + } + SetPresence("kaikki_logo", procName, "Kaikki logo"); return "Unsupported process"; }