DJS RPC

const RPC = require("discord-rpc");
const rpc = new RPC.Client({ transport: "ipc" });
const {
RPC_CLIENT_ID,
API_KEY,
EPIC_USERNAME,
BUTTONS,
} = require("./settings/config.json");
// MY CODE

rpc.login({
clientId: RPC_CLIENT_ID,
});
const RPC = require("discord-rpc");
const rpc = new RPC.Client({ transport: "ipc" });
const {
RPC_CLIENT_ID,
API_KEY,
EPIC_USERNAME,
BUTTONS,
} = require("./settings/config.json");
// MY CODE

rpc.login({
clientId: RPC_CLIENT_ID,
});
❯ node index
C:\Users\admin\Desktop\Files\FNStatsRPC\node_modules\discord-rpc\src\transports\ipc.js:32
reject(new Error('Could not connect'));
^

Error: Could not connect
at Socket.onerror (C:\Users\admin\Desktop\Files\FNStatsRPC\node_modules\discord-rpc\src\transports\ipc.js:32:16)
❯ node index
C:\Users\admin\Desktop\Files\FNStatsRPC\node_modules\discord-rpc\src\transports\ipc.js:32
reject(new Error('Could not connect'));
^

Error: Could not connect
at Socket.onerror (C:\Users\admin\Desktop\Files\FNStatsRPC\node_modules\discord-rpc\src\transports\ipc.js:32:16)
4 Replies
d.js toolkit
d.js toolkit16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Deleted & Will Never Return
Desktop\Files\FNStatsRPC is 📦 v1.0.0 via  v16.14.0 ❯ npm list discord-rpc [email protected] C:\Users\admin\Desktop\Files\FNStatsRPC -- [email protected] Error: Error: connect ENOENT \?\pipe\discord-ipc-10`
chewie
chewie16mo ago
Things to consider when getting a connection closed/could not connect error: • What transport are you using? If it's 'websocket', change that to 'ipc' • Is the ID you are trying to login with your user ID? If so, get one from the developer portal instead • Are you using the Discord app? It won't be able to connect to the web version • Is your code running on the same machine as the Discord app? • Are you trying to run it from WSL? If so, it won't be able to connect either • Have you installed Discord from the snap store? If so, install it from your distro's package repository or directly from the Discord website
Deleted & Will Never Return
1. ipc 2. Client ID of a App 3. Discord Desktop App (Windows; Public Client) 4. Yes 5. WSL?, I'm running from cmdline or terminal on VSC 6. N/A C:\Users\admin\Desktop\Bot\shop\ping\node_modules\discord-rpc\src\transports\ipc.js:32 reject(new Error('Could not connect')); ^ Error: Could not connectC:\Users\admin\Desktop\Bot\shop\ping\node_modules\discord-rpc\src\transports\ipc.js:32 reject(new Error('Could not connect')); ^ Error: Could not connect
Want results from more Discord servers?
Add your server