Closed Iamlel closed 2 years ago
The raw discord-rpc doesn't provide single field updates. Some libraries do provide it, but if its not available you will have to implement it yourself.
Just store the presence, make changes to that object, and then call setActivity on the entire object again:
let presence = {
details: 'stuff',
};
function setState(state) {
presence.state = state;
client.setActivity(presence);
}
^^^ pseudo example
const rpc = require("discord-rpc");
wrong repository, you're looking for https://github.com/discordjs/RPC
(but yes, what Lachee said is correct)
Hello, I am trying to update the
state
activity when someone hits a button in my app. I couldn't find anything on the docs for updating, so I tried setting the activity again, but it removes everything else. Is there a good way of only updating 1 parameter, or do i just save all the other parameters and add them in. my js file: