simply-xp 1.3.6 → 1.3.7

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "simply-xp",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "A Simple, Easy and Beginner Friendly XP System",
5
5
  "main": "simplyxp.js",
6
6
  "typings": "index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
- "beta": "eslint . --fix && npm update && npm publish --tag beta",
10
- "legacy": "eslint . --fix && npm update && npm publish --tag legacy"
9
+ "beta": "eslint . --fix && pnpm update && npm publish --tag beta",
10
+ "legacy": "eslint . --fix && pnpm update && npm publish --tag legacy"
11
11
  },
12
12
  "author": "Rahuletto",
13
13
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  "license": "Apache-2.0",
39
39
  "repository": {
40
40
  "type": "git",
41
- "url": "https://github.com/Abadima/simply-xp"
41
+ "url": "git+https://github.com/Abadima/simply-xp.git"
42
42
  },
43
43
  "homepage": "https://simplyxp.js.org",
44
44
  "dependencies": {
@@ -15,7 +15,7 @@ async function leaderboard(client, guildID, limit) {
15
15
 
16
16
  let leaderboard = await levels.find({guild: guildID}).sort([["xp", "descending"]]);
17
17
 
18
- let led = [];
18
+ let led = [], subtractPos = 0;
19
19
 
20
20
  function shortener(count) {
21
21
  const COUNT_ABBRS = ["", "k", "M", "T"];
@@ -29,9 +29,9 @@ async function leaderboard(client, guildID, limit) {
29
29
  const led2 = leaderboard.map(async (key) => {
30
30
  const user = await g.members.fetch(key.user).catch(() => null);
31
31
  if (!user && options?.auto_purge) return levels.deleteOne({user: key.user, guild: guildID});
32
- if (key.xp === 0) return;
32
+ if (key.xp === 0 || !user) return subtractPos++;
33
33
 
34
- let pos = leaderboard.indexOf(key) + 1;
34
+ let pos = leaderboard.indexOf(key) + 1 - subtractPos;
35
35
  if (limit && pos > Number(limit)) return;
36
36
 
37
37
  led.push({