Lachee / discord-rpc-csharp

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

[FEATURE REQUEST] Add AddButton and RemoveButton #147

Open HAHOOS opened 3 years ago

HAHOOS commented 3 years ago

Hello again, I have another thing that could be added, which is AddButton and RemoveButton like:

DiscordRpcClient client = new DiscordRpcClient("client-id");
client.AddButton("label", "url");
client.RemoveButton(index); //index is int
HAHOOS commented 3 years ago

oh i forgot to mension @Lachee

zoriV commented 3 years ago

Please, add it. I need it in my project <3

Mrgaton commented 3 years ago

how i can add butons plis help

Mrgaton commented 3 years ago

image

HAHOOS commented 3 years ago

if you want do like that, you can try this:

var btn1 = new Button();

btn1.Label = "Test"
btn1.Url = "Uri"
presence.Buttons[0] = btn1

But when i try it doesn't work

Lachee commented 3 years ago

if you want do like that, you can try this:

var btn1 = new Button();

btn1.Label = "Test"
btn1.Url = "Uri"
presence.Buttons[0] = btn1

But when i try it doesn't work

what do you mean "doesn't work". Please provide more details

@Mrgaton it needs to be an array

Mrgaton commented 3 years ago

if you want do like that, you can try this:

var btn1 = new Button();

btn1.Label = "Test"
btn1.Url = "Uri"
presence.Buttons[0] = btn1

But when i try it doesn't work

what do you mean "doesn't work". Please provide more details

@Mrgaton it needs to be an array

i dont now how to do thath can u show me code plis im new in c# image

Lachee commented 3 years ago

if you want do like that, you can try this:

var btn1 = new Button();

btn1.Label = "Test"
btn1.Url = "Uri"
presence.Buttons[0] = btn1

But when i try it doesn't work

what do you mean "doesn't work". Please provide more details @Mrgaton it needs to be an array

i dont now how to do thath can u show me code plis im new in c# image

its an array... you need to declare an array. https://www.tutorialsteacher.com/csharp/array-csharp

Mrgaton commented 3 years ago

image Like this?

can u help me in discord please i have more questions I'm sorry for the inconvenience but I'm not good at programming in this programming language so I don't understand how it goes and I'm still not used to using libraries

Lachee commented 3 years ago

@Mrgaton, I do not help with introductory programming questions in discord or as issues. I expect users of my libraries and tools to know at least basic C# and programming. I just don't have the time to help every possible beginner, sorry 😢.

There are plenty of resources online to get you started and the examples show you how to do it 🤨

Please do some research outside this issue.

Mrgaton commented 3 years ago

:o thath example is what i need it thanks for solving my problem

one more question than what timestamp is it?

image Thanks <3

Mrgaton commented 3 years ago

o okey sory i now what is timestamp

Mrgaton commented 3 years ago

Okey u are awesome Lachee

Mrgaton commented 3 years ago

and i think i found an iuse image In mi discord tag i have the discriminator 0001 and in console only shows 1 this is the code image

Lachee commented 3 years ago

and i think i found an iuse image In mi discord tag i have the discriminator 0001 and in console only shows 1 this is the code image

see issue #150 Issue locked to prevent further off-topic conversation