Discord Websocket RPC

164 Views Asked by At

Why does the rich presence update stop working when I add the "buttons" array to the activity in the following code?

What is working

this.ws.send(JSON.stringify({
    op: 3,
    d: {
        since: null,
        activities: [{
            name: "Test",
            type: 0,
            state: "Test",
            timestamps: {
                start: Date.now()
            },
            assets: {
                large_image: "mp:app-assets/745754363136789162/1128357789126971696.png",
                large_text: "Test",
            },
        }],
        status: "online",
        afk: false
    }
}));

What is not working

this.ws.send(JSON.stringify({
    op: 3,
    d: {
        since: null,
        activities: [{
            name: "Test",
            type: 0,
            state: "Test",
            timestamps: {
                start: Date.now()
            },
            assets: {
                large_image: "mp:app-assets/745754363136789162/1128357789126971696.png",
                large_text: "Test",
            },
            buttons: [{
                label: "Test",
                url: "https://google.com"
            }]
        }],
        status: "online",
        afk: false
    }
}));

When I execute this code, the rich presence is displayed correctly. However, once I add the "buttons" array to the activity, the rich presence no longer updates. What can I do to resolve this issue?

I would greatly appreciate any insights or suggestions on how to make the rich presence update properly while still including the buttons array in the activity. Additionally, clarification on any potential nuances or requirements when using buttons in the rich presence would be helpful. Thank you in advance for your assistance in resolving this issue.

0

There are 0 best solutions below