Coathar
Coathar
DIAdiscord.js - Imagine an app
Created by Coathar on 4/19/2024 in #djs-questions
RPC instantly disconnecting
I'm currently trying to create a RPC client inside of a Nuxt application and run it client-side, but whatever I try the connection is instantly closed with just a connection closed error. I'm not sure if what I'm trying to do just isn't feasible or what I would be missing exactly Here's what I'm trying to use currently:
import RPC from 'discord-rpc';

const client = new RPC.Client({ transport: 'ipc' });
const scopes = ['identify', 'rpc', 'rpc.voice.read', 'rpc.voice.write', 'guilds']

await client.login({
clientID: "<client id>",
scopes: scopes
}).catch((err) => {
console.log("Login err: ".concat(err));
});
import RPC from 'discord-rpc';

const client = new RPC.Client({ transport: 'ipc' });
const scopes = ['identify', 'rpc', 'rpc.voice.read', 'rpc.voice.write', 'guilds']

await client.login({
clientID: "<client id>",
scopes: scopes
}).catch((err) => {
console.log("Login err: ".concat(err));
});
2 replies