This repository has been archived by the owner on Aug 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcmd_fortnite.js
67 lines (66 loc) · 2.52 KB
/
cmd_fortnite.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
56
57
58
59
60
61
62
63
64
65
66
67
const Client = require('fortnite');
const fortnite = new Client('d4dd5075-f93a-4638-b655-29b6e8025561');
module.exports = function(param, clientArg, args) { // it sends cats
if (args) {
try {
fortnite.user(args, 'pc').then(data => {
let stats = data.stats.lifetime
console.log(stats)
let score = stats[6]['Score']
let kills = stats[10]['Kills']
let kd = stats[11]['K/d']
let winperc = stats[9]['Win%'] // oWO
let wins = stats[8]['Wins']
let matches = stats[7]['Matches Played']
const leembed = {
"embed": {
"title": data.username,
"color": 2076421,
"timestamp": new Date(),
"footer": {
"text": "~fortnite"
},
"fields": [{
"name": "Kills",
"value": kills,
"inline": true
},
{
"name": "K/D",
"value": kd,
"inline": true
},
{
"name": "Score",
"value": score,
"inline": true
},
{
"name": "Matches played",
"value": matches,
"inline": true
},
{
"name": "Wins",
"value": wins,
"inline": true
},
{
"name": "Win percentage",
"value": winperc,
"inline": true
}
]
}
};
param.channel.createMessage(leembed);
});
} catch (err) {
if (err) {
param.channel.createMessage(":x: ``User not found!``");
}
}
} else {
param.channel.createMessage(":x: ``You need to specify a username!``");
}
};