コード例 #1
0
        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();
        }
コード例 #2
0
 protected override void OnStop()
 {
     WriteLog("Paladins Presence is stopping.");
     client.Dispose();
 }
コード例 #3
0
 public void Dispose()
 {
     discord?.Dispose();
 }