MTMB
MTMB
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by MTMB on 7/24/2023 in #djs-questions
How can I change the status from "playing" to "listening" using the `discord-rpc` npm package?
I'm adding rich presence to my application, however it's not a game. How can I replace the text that says playing, and make it say listening? I know that it can be done with bots, however I'm not sure how to do it with rpc. Here is my current code:
const clientId = "1130369366341455872";
const rpc = new discord.Client({ transport: "ipc" });
discord.register(clientId);

async function setRpc(text) {
rpc.setActivity({
details: text,
largeImageKey: "large"
});
}

rpc.on("ready", async () => {
setRpc("test 123");
});

rpc.login({ clientId }).catch(error => console.error(error));
const clientId = "1130369366341455872";
const rpc = new discord.Client({ transport: "ipc" });
discord.register(clientId);

async function setRpc(text) {
rpc.setActivity({
details: text,
largeImageKey: "large"
});
}

rpc.on("ready", async () => {
setRpc("test 123");
});

rpc.login({ clientId }).catch(error => console.error(error));
I tried looking online, at documentation, and asking AI but I couldn't find a working answer.
13 replies