Esempio n. 1
0
 public static void SetDiscordRPCStatus(string details)
 {
     if (DiscordRPCEnabled == true)
     {
         try
         {
             if (client != null)
             {
                 client.SetPresence(new DiscordRPC.RichPresence()
                 {
                     Details    = details,
                     Timestamps = new DiscordRPC.Timestamps()
                     {
                         Start = DateTime.UtcNow
                     },
                     Assets = new DiscordRPC.Assets()
                     {
                         LargeImageKey = "bigwk", LargeImageText = "WolvenKit",
                     }
                 });
                 client.Invoke();
             }
         }
         catch { }
     }
 }
Esempio n. 2
0
        public void InitDiscordRPC()
        {
            client = new DiscordRPC.DiscordRpcClient("807752124078620732");

            //Set the logger
            client.Logger = new DiscordRPC.Logging.ConsoleLogger()
            {
                Level = DiscordRPC.Logging.LogLevel.Warning
            };

            //Subscribe to events
            client.OnReady += (sender, e) =>
            {
                Console.WriteLine("Received Ready from user {0}", e.User.Username);
            };

            client.OnPresenceUpdate += (sender, e) =>
            {
                Console.WriteLine("Received Update! {0}", e.Presence);
            };

            //Connect to the RPC
            client.Initialize();

            //Set the rich presence
            //Call this as many times as you want and anywhere in your code.
            client.SetPresence(new DiscordRPC.RichPresence()
            {
                Details = "Launching",

                Assets = new DiscordRPC.Assets()
                {
                    LargeImageKey  = "bigwolf",
                    LargeImageText = "Testing",
                    SmallImageKey  = "bigwolf"
                }
            });
            client.Invoke();
        }
Esempio n. 3
0
 private void InvokeTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     client.Invoke();
 }