simply-xp 1.1.8 → 1.2.0-test-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -9
- package/package.json +6 -4
- package/simplyxp.js +1 -1
- package/src/rank.js +2 -2
- package/src/reset.js +7 -13
package/README.md
CHANGED
|
@@ -30,13 +30,8 @@ yarn add simply-xp
|
|
|
30
30
|
|
|
31
31
|
# 🎉 What's New 🎉
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
- roleSetup redefined.. Redid whole system.
|
|
36
|
-
- New everything.. Everything is now tidy and compact.
|
|
37
|
-
- levelUp event returns role id too !
|
|
38
|
-
- Re-coded to squeeze bugs
|
|
39
|
-
- Bug Fixes
|
|
33
|
+
- We have patched known issues, and we continue to monitor changes!
|
|
34
|
+
- Our rank card has a new font applied
|
|
40
35
|
|
|
41
36
|
# But Why ?
|
|
42
37
|
|
|
@@ -48,8 +43,6 @@ yarn add simply-xp
|
|
|
48
43
|
- Inbuilt Auto Roles system
|
|
49
44
|
- Flexible and simple at the same time
|
|
50
45
|
|
|
51
|
-
`Reconstructed discord-xp to give you things simpler ;)`
|
|
52
|
-
|
|
53
46
|
<br>
|
|
54
47
|
|
|
55
48
|
## **Need Help ? Join the [Discord Server](https://discord.gg/3JzDV9T5Fn)**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simply-xp",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.0-test-1",
|
|
4
4
|
"description": "A Simple, Easy and Beginner Friendly XP System",
|
|
5
5
|
"main": "simplyxp.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -40,13 +40,15 @@
|
|
|
40
40
|
"url": "https://github.com/Rahuletto/simply-xp"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"canvas": "^2.
|
|
44
|
-
"chart.js-image": "^
|
|
45
|
-
"discord.js": "^13.8.0",
|
|
43
|
+
"canvas": "^2.9.3",
|
|
44
|
+
"chart.js-image": "^6.0.3",
|
|
46
45
|
"mongoose": "^6.0.15"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"husky": "^7.0.0",
|
|
50
49
|
"pretty-quick": "^3.1.1"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"discord.js": "^13.x.x"
|
|
51
53
|
}
|
|
52
54
|
}
|
package/simplyxp.js
CHANGED
package/src/rank.js
CHANGED
|
@@ -18,7 +18,7 @@ async function rank(message, userID, guildID, options = []) {
|
|
|
18
18
|
user: userID,
|
|
19
19
|
guild: guildID
|
|
20
20
|
})
|
|
21
|
-
if (!user)
|
|
21
|
+
if (!user) throw new Error('[XP] NO_DATA | User has no XP data.')
|
|
22
22
|
|
|
23
23
|
const leaderboard = await levels
|
|
24
24
|
.find({
|
|
@@ -52,7 +52,7 @@ async function rank(message, userID, guildID, options = []) {
|
|
|
52
52
|
registerFont(join(__dirname, 'Fonts', 'Baloo-Regular.ttf'), { family: 'Sans Serif' })
|
|
53
53
|
|
|
54
54
|
function shortener(count) {
|
|
55
|
-
const COUNT_ABBRS = ['', 'k', 'M', 'T']
|
|
55
|
+
const COUNT_ABBRS = ['', 'k', 'M', 'B', 'T', 'Q', 'Q+', 'S', 'S+', 'O', 'N', 'D', 'U']
|
|
56
56
|
|
|
57
57
|
const i =
|
|
58
58
|
0 === count ? count : Math.floor(Math.log(count) / Math.log(1000))
|
package/src/reset.js
CHANGED
|
@@ -10,19 +10,13 @@ async function reset(userID, guildID) {
|
|
|
10
10
|
|
|
11
11
|
if (!guildID) throw new Error('[XP] User ID was not provided.')
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
await levels
|
|
14
|
+
.findOneAndUpdate({ user: userID, guild: guildID }, { xp: 0, level: 0 })
|
|
15
|
+
.catch((err) => {
|
|
16
|
+
throw new Error(err)
|
|
17
|
+
})
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
user: userID,
|
|
17
|
-
guild: guildID,
|
|
18
|
-
xp: 0,
|
|
19
|
-
lvl: 0
|
|
20
|
-
})
|
|
21
|
-
await uzer
|
|
22
|
-
.save()
|
|
23
|
-
.catch((e) => console.log(`[XP] Failed to save new use to database`))
|
|
24
|
-
|
|
25
|
-
return true
|
|
19
|
+
return { user: userID, guild: guildID, xp: 0, level: 0 }
|
|
26
20
|
}
|
|
27
21
|
|
|
28
|
-
module.exports = reset
|
|
22
|
+
module.exports = reset
|