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
/
cmd_osu.js
68 lines (67 loc) · 1.71 KB
/
cmd_osu.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
68
const osu = require('node-osu');
var osuApi = new osu.Api('9616a3ac1052a3ef6dfb71ddb5ab5e6164bdde61', { //dont touchy touchy
// baseUrl: sets the base api url (default: https://osu.ppy.sh/api)
notFoundAsError: true, // Reject on not found instead of returning nothing. (default: true)
completeScores: false // When fetching scores also return the beatmap (default: false)
})
module.exports = function(param, clientArg, args) {
osuApi.getUser({u: args}).then(user => {
console.log(user)
const data = {
"embed": {
"color": 14572227,
"timestamp": new Date(),
"footer": {
"icon_url": "https://cdn.discordapp.com/avatars/255397678492418048/a8e516d198c913fb897aa592ce21e260.png",
"text": "~osu"
},
"thumbnail": {
"url": "https://a.ppy.sh/"+user.id+"?cth103issexy.png"
},
"author": {
"name": user.name,
"url": "https://osu.ppy.sh/users/"+user.id,
"icon_url": "https://i.imgur.com/zNHG9dC.png"
},
"fields": [
{
"name": "ID",
"value": user.id,
"inline": true
},
{
"name": "PP",
"value": user.pp.raw,
"inline": true
},
{
"name": "Rank",
"value": user.pp.rank,
"inline": true
},
{
"name": "Country rank",
"value": user.country+" #"+user.pp.countryRank,
"inline": true
},
{
"name": "Level",
"value": user.level,
"inline": true
},
{
"name": "Accuracy",
"value": user.accuracy,
"inline": true
},
{
"name": "Plays",
"value": user.counts.plays,
"inline": true
}
]
}
};
param.channel.createMessage(data);
});
};