private void InitializeDiscord() { discord = new DiscordRPC.DiscordRpcClient("689105200262414377"); discord.OnError += (a, s) => { logger.Error($"{s.Code}, {s.Type}, {s.Message}"); }; discord.OnConnectionEstablished += (a, s) => { isConnected = true; isConnecting = false; }; discord.OnConnectionFailed += (a, s) => { isConnecting = false; isConnected = false; discord.Deinitialize(); discord.Dispose(); logger.Error("Discord connection failed"); }; isConnecting = true; discord.Initialize(); }
protected override void OnStop() { WriteLog("Paladins Presence is stopping."); client.Dispose(); }
public void Dispose() { discord?.Dispose(); }