body: { error: 'invalid_client' }

const e = new Error(r.status); ^ Error: 401 at D:\RPC\node_modules\discord-rpc\src\client.js:64:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async RPCClient.authorize (D:\RPC\node_modules\discord-rpc\src\client.js:215:22) at async RPCClient.login (D:\RPC\node_modules\discord-rpc\src\client.js:143:21) { body: { error: 'invalid_client' } }
10 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
RichtigJoJo
RichtigJoJo12mo ago
const DiscordRPC = require("discord-rpc")

const client = new DiscordRPC.Client({transport: "ipc"})


client.on("ready", () => {
client.setActivity({
details: "det",
state: "state",
startTimestamp: new Date(2023, 10, 24, 12)
})
})


client.login({clientId: "", scopes: ['rpc'], redirectUri: "http://127.0.0.1"})
const DiscordRPC = require("discord-rpc")

const client = new DiscordRPC.Client({transport: "ipc"})


client.on("ready", () => {
client.setActivity({
details: "det",
state: "state",
startTimestamp: new Date(2023, 10, 24, 12)
})
})


client.login({clientId: "", scopes: ['rpc'], redirectUri: "http://127.0.0.1"})
treble/luna
treble/luna12mo ago
not djs related, #other-js-ts
RichtigJoJo
RichtigJoJo12mo ago
for what is this tag?
treble/luna
treble/luna12mo ago
didnt know there was a tag nor this was made by the same devs anyhow you provided an invalid id and from the looks of your code you didnt provided anything at all
RichtigJoJo
RichtigJoJo12mo ago
I have a Application ID there
Squid
Squid12mo ago
Can you try just doing cilent.login({ clientId: "id here"}) without the other options?
RichtigJoJo
RichtigJoJo12mo ago
yes Thanks, it works but how can I make a timer until a date?
Squid
Squid12mo ago
I would assume that you'd use the endTimestamp option instead of using startTimestamp
RichtigJoJo
RichtigJoJo12mo ago
makes sense thanks