You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var RPC=require('discord-rpc');
const clientId = 'XXXXXXXXXXXXXXXX';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
const client = new RPC.Client({ transport: 'websocket' });
client.on('ready', () => {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('81384788862181376');
});
// Log in to RPC with client id
client.login({ clientId, scopes });
I get the error
discordtest\node_modules\discord-rpc\src\transports\WebSocket.js:52
this.client.rest.endpoint = `http://${this.hostAndPort}`;
^
TypeError: Cannot set property 'endpoint' of undefined
at WebSocketTransport.onOpen (C:\Users\pbx06\WebstormProjects\discordtest\node_modules\discord-rpc\src\transports\WebSocket.js:52:31)
at WebSocket.onOpen (C:\Users\pbx06\WebstormProjects\discordtest\node_modules\discord-rpc\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:182:13)
at WebSocket.setSocket (C:\Users\pbx06\WebstormProjects\discordtest\node_modules\discord-rpc\node_modules\ws\lib\websocket.js:151:10)
at ClientRequest.req.on (C:\Users\pbx06\WebstormProjects\discordtest\node_modules\discord-rpc\node_modules\ws\lib\websocket.js:602:10)
at ClientRequest.emit (events.js:182:13)
at Socket.socketOnData (_http_client.js:453:11)
at Socket.emit (events.js:182:13)
at addChunk (_stream_readable.js:280:12)
at readableAddChunk (_stream_readable.js:265:11)
Waiting for the debugger to disconnect...
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
pabx06
changed the title
this.client.rest.endpoint
Error this.client.rest.endpoint
Sep 29, 2018
trying with nodejs code:
I get the error
The text was updated successfully, but these errors were encountered: