-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.js
37 lines (32 loc) · 892 Bytes
/
main.js
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
// Core part of Wrapper: Offline
const RPC = require("discord-rpc");
require("./server");
// Loads env.json for Wrapper version and build number
const env = Object.assign(process.env,
require('./env'));
// env.json variables
let version = env.WRAPPER_VER;
let build = env.WRAPPER_BLD;
// Discord rich presence
const rpc = new RPC.Client({
transport: "ipc"
});
rpc.on("ready", () => {
// Sets RPC activity
rpc.setActivity({
// state: "Video List",
// disabled until automatic rpc status is done
details: "Version " + version +", build " + build,
startTimestamp: new Date(),
largeImageKey: "icon",
largeImageText: "Wrapper: Offline",
smallImageKey: "Wrapper: Offline",
smallImagetext: "Wrapper: Offline",
});
// Logs "Rich presence is on!" in the console
console.log("Rich presence is on!")
});
// Connects RPC to app
rpc.login({
clientId: "825080302178926633"
});