Lachee / discord-rpc-csharp

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

How Add Rich presence Buttons #164

Closed ChickChuck2 closed 2 years ago

ChickChuck2 commented 2 years ago

Hi, I'm trying to add buttons to my rich presence, but I'm lost, I don't know how to put it, I've already tried one way, but I don't know how to continue it, here's a piece of code

RPCClient.SetPresence(new DiscordRPC.RichPresence() { Buttons = new DiscordRPC.Button[] { }, });

well, I managed only up to this part, and on the button I would have to add Label and Url

ChickChuck2 commented 2 years ago

I got it, for those interested in buttons, here it is

DiscordRPC.Button btns = new DiscordRPC.Button();
btns.Label = "Sex";
btns.Url = "https://www.youtube.com";

RPCClient.SetPresence(new DiscordRPC.RichPresence()
                    {
                        Buttons = new DiscordRPC.Button[]
                        {
                            btns
                        },
});

Max: 2 buttons