forked from RLX-OP/Rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (30 loc) · 1.13 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
const express = require("express");
require("dotenv");
const app = express()
app.get("/",(rex, res) => {
res.send("Hello World")
})
app.listen(3000, () => {
console.log("project is ready")
});
const rpc = require("discordrpcgenerator");
const discord = require("discord.js-selfbot-v11");
const client = new discord.Client()
const config = require("./config.json")
client.on("ready", () => {
rpc.getRpcImage(config.applicationid, config.imagename).then(large => {
let presence = new rpc.Rpc()
.setName(config.name)
.setUrl('https://www.twitch.tv/hml_cp0')
.setType(config.type)
.setApplicationId(config.applicationid)
.setState(config.state)
.setDetails(config.details)
.setAssetsLargeImage(large.id)
.setAssetsSmallImage(config.imagesmall)
.setStartTimestamp(Date.now())
client.user.setPresence(presence.toDiscord()).catch(console.error);
})
console.log("Your rpc has successfully been setuped")
})
client.login(process.env.TOKEN)