-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (32 loc) · 1.26 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
const clientId = '';
const DiscordRPC = require('discord-rpc');
const RPC = new DiscordRPC.Client({ transport: 'ipc'});
DiscordRPC.register(clientId);
async function setActivity() {
if(!RPC) return;
RPC.setActivity({ // Put here what you want, your links, your stream titles, the image etc...
details: `Rejoins l'aventure sur Starbound !`,
startTimestamp: Date.now(),
largeImageKey: 'kicklogo',
smallImageKey: 'kicklogo',
instance: false,
buttons: [ //Here you put the buttons you want (label = title, url = link).
{
label: `Rejoins moi sur Kick !`,
url: 'https://kick.com/mandodb'
},
{
label: `Rejoins le Discord !`,
url: 'https://discord.gg/la-station'
}
]
});
};
RPC.on('ready', async () => { // RPC.on run the script
console.log(`Script is running now...`);
setActivity();
setInterval(() => { //With setInterval the script will check that the status is still working.
setActivity();
}, 15 * 1000);
});
RPC.login({ clientId }).catch(err => console.error(err)); //Le script se connecte au systeme de status et vérifie que l'ID fonctionne.