Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons are not working #123

Closed
YodaLightsabr opened this issue Mar 10, 2021 · 15 comments
Closed

Buttons are not working #123

YodaLightsabr opened this issue Mar 10, 2021 · 15 comments

Comments

@YodaLightsabr
Copy link

image
What am I supposed to pass to the object? I have tried many different configurations, but there's no documentation about it and I keep getting errors.

@xiBread
Copy link

xiBread commented Mar 10, 2021

It's the same as ActivityOptions. Disregard, was looking at the wrong docs.

@YodaLightsabr
Copy link
Author

YodaLightsabr commented Mar 10, 2021

It's the same as ActivityOptions. Disregard, was looking at the wrong docs.

Oops that's okay.

@YodaLightsabr
Copy link
Author

    {
        "startTimestamp": "Date.now()",
        "details": "Google",
        "buttons": [
            { "label": "Google1", "url": "https://google.com" },
            { "label": "Google2", "url": "https://google.com" }
        ]
    }

that's the object I'm passing, but the buttons are not working.

@advaith1
Copy link

  1. what version are you on?
  2. wdym "not working"?

@NotSugden
Copy link

#91 does add documentation for this

@YodaLightsabr
Copy link
Author

  1. what version are you on?
  2. wdym "not working"?
  1. Previously 3.1.4, but I updated and it still didn't work
  2. Everything works except for the buttons. Also, the object I'm passing is essnetially read from a JSON file and it replaces "Date.now()" as a string with the time that the status is set so that the time can be from when I start my program.
    image
    That's a picture of what the status looks like, where the buttons should be working, but they aren't.

@YodaLightsabr
Copy link
Author

#91 does add documentation for this

Ok, so after looking at that, my buttons property is an array of two button objects. They look like:

{ "label": "Visit Google", "url": "https://google.com" }

just like it is supposed to, but it's not working. The buttons aren't being displayed.

@YodaLightsabr YodaLightsabr changed the title No documentation on what the Discord RPC object actually looks like Buttons are not working Mar 12, 2021
@cocoliliace
Copy link

I am on 3.2.0 and it works for me. The arguments you pass in look right, so my guess is this:
You said you are reading from a JSON file and replacing certain fields. Are you parsing the JSON file correctly? Maybe try to console.log the json data and use typeof to check the data type of each field in the json. Make sure they are an array of objects, not a string

@YodaLightsabr
Copy link
Author

Okay I'll show you what the console.log'd data looks like

@YodaLightsabr
Copy link
Author

image

@YodaLightsabr
Copy link
Author

@ChingChang9 There you go ^

@advaith1
Copy link

Have you tried fully uninstalling and reinstalling discord-rpc? it may not have updated properly

@cocoliliace
Copy link

cocoliliace commented Mar 13, 2021

Hm yeah it seems to be in the proper format. Check your node_modules/discord-rpc/src/client.js. It should have buttons: args.buttons, on line 537 if you're on 3.2.0. Otherwise, you might have not updated the package properly.

@YodaLightsabr
Copy link
Author

Good idea. Give me a minute.

@YodaLightsabr
Copy link
Author

Welp. Apparently my package.json got moved to the parent directory somehow, and when I ran npm install it said

removed 3 packages in 0.622s

so I fixed that and now it's working. Sorry for bugging the issue section about my stupid mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants