Comments (10)
How do u give the rpc client the client id?
from rpc.
it detects 2 different games, ATS or ETS2, it switches to the game. We have the main index.js which goes to RichPresenceManager.js then the config.js which has the IDs,
The config.js shows
applications: {
ets2: '432559364772200479',
ats: '454028920107565107',
},
The RichPresenceManager.js shows
if (!instance.rpcReady) { instance.rpcOnChangingState = true; // getting application id (default ETS2) var applicationID = config.applications.ets2; // checking if playing ATS if (instance.isAts(data)) { applicationID = config.applications.ats; instance.logger.info('Game detected: ATS'); } else instance.logger.info('Game detected: ETS2'); instance.logger.info(`Using Discord Application ID ${applicationID}`); // creating a new Discord RPC Client instance instance.rpc = new DiscordRPC.Client({ transport: 'ipc' }); // login to RPC instance.rpc.login(applicationID).then(() => { instance.logger.info('Discord RPC ready'); // cleaning up variables to save RPC Client state instance.rpcReady = true; instance.rpcOnChangingState = false; }).catch(console.error); }
The version on github is this
https://github.com/VirtualTruckerRPC/Virtual-Trucker-Rich-Presence
from rpc.
Here you go, the correct way to login as per the example.
from rpc.
I have gone and set it to the correct way to login and when the Discord-RPC destroy function is called it shows this error. It hasn't done this is previous versions either...
Discord RPC Client destroyed
MP Checker interval reset
Location Checker interval reset
(node:14760) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).destroy is not a function
at RPCClient.destroy (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\discord-rpc\src\Client.js:639:11)
at RichPresenceManager.destroyRPCClient (C:\Users\supac\Desktop\Things\VT-RPC 2\RichPresenceManager.js:324:22)
at ETCarsClient. (C:\Users\supac\Desktop\Things\VT-RPC 2\RichPresenceManager.js:139:22)
at ETCarsClient.emit (events.js:182:13)
at ETCarsClient.receiveError (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\etcars-node-client\index.js:181:14)
at Socket.etcarsSocket.on (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\etcars-node-client\index.js:88:26)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:14760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:14760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Discord RPC Client destroyed
(node:14760) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).destroy is not a function
at RPCClient.destroy (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\discord-rpc\src\Client.js:639:11)
at RichPresenceManager.destroyRPCClient (C:\Users\supac\Desktop\Things\VT-RPC 2\RichPresenceManager.js:324:22)
at ETCarsClient. (C:\Users\supac\Desktop\Things\VT-RPC 2\RichPresenceManager.js:139:22)
at ETCarsClient.emit (events.js:182:13)
at ETCarsClient.receiveError (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\etcars-node-client\index.js:181:14)
at Socket.etcarsSocket.on (C:\Users\supac\Desktop\Things\VT-RPC 2\node_modules\etcars-node-client\index.js:88:26)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:14760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
from rpc.
@SgtBreadStick can you verify what version of rpc you're using
from rpc.
from rpc.
I dont know soo much about RPC.
But i think you need to use this:
rpc.login({ clientId: ClientId });
from rpc.
After many attempts it still shows the same error, i will keep the rpc downgraded to the previous version that worked, i tried literally everything and still same error everytime
from rpc.
@SgtBreadStick i think your RichPresenceManager.destroyRPCClient
has some bugs.
i recommend using https://npmjs.org/discord-rich-presence. it will handle ratelimits and connections and everything for you.
from rpc.
i'll try that, see how it goes, thanks. I dont understand why it does this because it was fine before
EDIT:
i still keep getting error 4000 yet it is all correct
from rpc.
Related Issues (20)
- error: connection closed HOT 5
- Is it possible that this library gets way to set Activity Types? HOT 4
- Discord RPC via Browser HOT 2
- Events fire twice HOT 1
- Subscriptions not working HOT 5
- Better Documentation 📖 HOT 5
- Subscriptions not working (VOICE_STATE_CREATE, VOICE_STATE_UPDATE, VOICE_STATE_DELETE) HOT 1
- ERROR in ./node_modules/discord-rpc/src/client.js 8:4-21 HOT 1
- Unhandled Promise Rejection: ReferenceError: Can't find variable: process
- Buttons not working properly HOT 3
- rpc scope not found HOT 1
- GET_SELECTED_VOICE_CHANNEL method
- discord-rpc in conjunction with Vue 2
- Error when attempting to run example from my linux VPS
- Error: child "id" fails because ["id" must be a string] HOT 1
- RPC Documentation Missing HOT 2
- Error: connection closed
- Socket error HOT 1
- Could not connect on Linux HOT 1
- Will this package be depreceated?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpc.