Skip to content

Commit acfb7e8

Browse files
authored
Merge pull request #2 from OpenAsar/main
2 parents 38b534a + 2234e9c commit acfb7e8

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ Rich Presence (RPC) is the name for how some apps can talk to Discord desktop on
2525

2626
## Usage
2727

28-
### Server (**REQUIRED**)
29-
1. Have latest (>=18) Node installed
30-
2. Clone GitHub repo
31-
3. `npm install`
32-
4. Run server with `node src`
28+
### Server
29+
Run `npx arrpc` in a terminal. Make sure you have a modern (>=18) version of [Node.js](https://nodejs.org) installed.
3330

3431
### Web
3532
#### No Mods
@@ -42,8 +39,8 @@ Rich Presence (RPC) is the name for how some apps can talk to Discord desktop on
4239

4340
### Custom Clients
4441

45-
#### ArmCord
46-
ArmCord has arRPC specially integrated, just enable the option in it's settings (server not required)!
42+
#### ArmCord, Vesktop
43+
These clients have arRPC specially integrated, just enable the option in its settings (server not required)!
4744

4845
#### Webcord
4946
1. Get [the arRPC server running](#server-required)

examples/bridge_mod.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ ws.onmessage = async x => {
1515

1616
for (const id in modules) {
1717
const mod = modules[id].exports;
18-
if (!mod?.__esModule) continue;
18+
// if (!mod?.__esModule) continue;
1919

2020
for (const prop in mod) {
21-
if (!mod.hasOwnProperty(prop)) continue;
21+
// if (!mod.hasOwnProperty(prop)) continue;
2222

2323
const candidate = mod[prop];
24-
if (candidate && candidate.register && candidate.wait) {
25-
Dispatcher = candidate;
26-
break;
27-
}
24+
try {
25+
if (candidate && candidate.register && candidate.wait) {
26+
Dispatcher = candidate;
27+
break;
28+
}
29+
} catch {}
2830
}
2931

3032
if (Dispatcher) break;

src/server.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ export default class RPCServer extends EventEmitter {
168168
break;
169169

170170
case 'DEEP_LINK':
171-
this.emit('link', args.params);
171+
const deep_callback = (success) => {
172+
socket.send({ cmd, data: null, evt: success ? null : 'ERROR', nonce });
173+
}
174+
this.emit('link', args, deep_callback);
172175
break;
173176
}
174177
}

0 commit comments

Comments
 (0)