#DJS RPC

7 messages · Page 1 of 1 (latest)

umbral hamlet
#
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)```
idle tinselBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
umbral hamlet
#

Error: Error: connect ENOENT \\?\pipe\discord-ipc-10

visual furnace
#

Is discord running on your PC when you try that? RPC doesn’t seem to find an open IPC channel to talk to it

raw spear
#

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

umbral hamlet