public static void UpdateRichPresence(string details = null) { if (!DiscordEnabled) { controller?.Shutdown(); controller = null; } else { if (controller == null) { InitRichPresence(); } details = ""; //don't like current imp. string detailsLine = string.IsNullOrEmpty(details) ? CustomStateText : details; controller.presence.state = DiscordStateEnabled ? detailsLine : null; string vString = Debugger.IsAttached ? "DEBUG " : "RELEASE "; vString += Version; controller.presence.details = DiscordDetailsEnabled ? vString : null; controller.presence.startTimestamp = DiscordElapsedTimeEnabled ? ElapsedTime : 0; controller.UpdatePresence(); } }
protected override void OnClosed(EventArgs e) { DiscordController.Shutdown(); base.OnClosed(e); Environment.Exit(0); }