forked from OdarArmy/EasyDiscordPresence
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
55 lines (47 loc) · 1.25 KB
/
index.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const Discord = require("discord-rpc")
const settings = require("./settings.json")
const startTimestamp = new Date()
const ID = settings.ID
const LI = settings.LargeImage
const LT = settings.LargeText
const SI = settings.SmallImage
const ST = settings.SmallText
const time = settings.Time
const dtls = settings.Details
const ste = settings.State
console.log(`ID: ${ID}`)
console.log(`Details: ${dtls}`)
console.log(`State: ${ste}`)
console.log(`Large Text: ${LT}`)
console.log(`Large Image: ${LI}`)
console.log(`Small Text: ${ST}`)
console.log(`Small Image: ${SI}`)
console.log(`Time: ${time}`)
//TODO - COOLDOWN
Discord.register(ID)
const rpc = new Discord.Client({transport: "ipc"});
rpc.on("ready", () => {
if(time === true){
rpc.setActivity({
details: dtls,
state: ste,
startTimestamp,
largeImageKey: LI,
smallImageKey: SI,
largeImageText: LT,
smallImageText: ST,
instance: false
})
} else {
rpc.setActivity({
details: dtls,
state: ste,
largeImageKey: LI,
smallImageKey: SI,
largeImageText: LT,
smallImageText: ST,
instance: false
})
}
})
rpc.login(ID).catch(console.error)