Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
561 stars 93 forks source link

How can i update for example LargeImage without reseting timestamp? #187

Closed sepi1385 closed 2 years ago

sepi1385 commented 2 years ago

this is my code and it gets information from the textbox in the form and enters them with the "update" button. this is the code:

                client.SetPresence(new DiscordRPC.RichPresence()
                {
                    Details = $"{textBox2.Text}",
                    State = $"{textBox1.Text}",
                    Timestamps = Timestamps.Now,
                    Buttons = new Button[]
                    {
                        new Button() { Label = "Website", Url = "https://codeium.net/" },
                        new Button() { Label = "Discord", Url = "https://discord.gg/PvBND5UC" }
                    },
                    Assets = new Assets()
                    {
                        LargeImageKey = $"{textBox5.Text}",
                        LargeImageText = "Codeium",
                        SmallImageKey = $"{textBox4.Text}"
                    }

                });
Lachee commented 2 years ago

By not using Timestamps.Now or storing that elsewhere. This example is designed to show you how to use the API, prior ability to program is expected.

For example:

var presence = new DiscordRPC.RichPresence()
                {
                    ...
                };

client.SetPresence(presence);

... later ....
presence.Assets.LargeImageKey = "FishSticks";
client.SetPresence(presence);
sepi1385 commented 2 years ago

i did that but timestamp still resets