-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch.diff
44 lines (43 loc) · 1.28 KB
/
patch.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff --git a/package.json b/package.json
index 8771438..86f2148 100755
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"author": "Orteil",
"license": "ISC",
"dependencies": {
+ "discord-rpc": "^4.0.1",
"adm-zip": "^0.5.9",
"steamapi": "^2.1.1"
}
}
\ No newline at end of file
diff --git a/preload.js b/preload.js
index 5328be8..c715cd8 100755
--- a/preload.js
+++ b/preload.js
@@ -3,7 +3,7 @@ const {contextBridge,ipcRenderer}=require('electron');
contextBridge.exposeInMainWorld(
'api',{
send:(channel,data)=>{
- if (channel=='toMain') ipcRenderer.send(channel,data);
+ if (channel=='toMain'||channel=='discord') ipcRenderer.send(channel,data);
},
receive:(channel,func)=>{
if (channel=='fromMain') ipcRenderer.on(channel,(e,...args)=>func(...args));
diff --git a/start.js b/start.js
index f900c9c..29a275c 100755
--- a/start.js
+++ b/start.js
@@ -326,6 +326,12 @@ function createWindow(){
win.loadFile(path.join(__dirname,'/src/index.html'),BETA?{query:{'beta':'1'}}:{});
if (DEV) win.webContents.openDevTools();
},1000*splashDur);
+
+ //DiscordRPC
+ const {setActivity}=require('./discordRPC');
+ ipcMain.on('discord', (e,args)=>{
+ setActivity(e,args);
+ });
}
app.whenReady().then(createWindow);