Skip to content

Commit 18ce809

Browse files
authored
fix(ws): implement a callback for deeplink events (#128)
* fix: implement a callback for deeplinks this is so discord web doesnt wait forever after emitting the event * emit the full args so clients can access the type * pass error This seems to have no difference compared to not sending a callback. Web will continue waiting for a non ERROR response
1 parent 5aadc30 commit 18ce809

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/server.js

Lines changed: 4 additions & 1 deletion
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)