simply-xp 1.3.3 → 1.3.4

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h2 style="font-size:2.5rem;" align="center">Simply-XP</h2>
4
4
 
5
- <h2 align="center">A Simple, Easy and Beginner friendly XP System. <br>Uses Discord.js v13<br><br>Developed by Rahuletto#0243 & Maintained by Abadima#6356</h2>
5
+ <h2 align="center">A Simple, Easy and Beginner friendly XP System. <br>Supports Discord.JS<br><br>Developed by Rahuletto#0243 & Maintained by Abadima#6356</h2>
6
6
 
7
7
  <br>
8
8
  <p align="center">
@@ -28,13 +28,12 @@ yarn add simply-xp
28
28
 
29
29
  <br>
30
30
 
31
- # 🎉 What's New 🎉
31
+ # 🎉 Recent Updates 🎉
32
+
33
+ - Fixed Various Bugs
34
+ - Updated `Chart.js`
35
+ - D.JS v14 Support
32
36
 
33
- - We have patched various issues
34
- - Switched to the true **Chart.js** package!
35
- - You no longer require to use D.JS for this package, alternatives can work!
36
- - We have also updated our website guide! We hope you find it useful 😊
37
- - Updated Various Packages to work universally with DJS V14 & More!
38
37
 
39
38
  # But Why ?
40
39
 
@@ -55,4 +54,4 @@ yarn add simply-xp
55
54
  <h1>👥 Contact us | Support</h1>
56
55
  <p>
57
56
  <a href="https://discord.gg/3JzDV9T5Fn"><img src="https://invidget.switchblade.xyz/3JzDV9T5Fn" /></a>
58
- </p>
57
+ </p>
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "simply-xp",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
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
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "prepare": "husky install"
8
+ "test": "echo \"Error: no test specified\" && exit 1"
10
9
  },
11
10
  "author": "Rahuletto",
12
11
  "keywords": [
@@ -40,14 +39,10 @@
40
39
  "url": "https://github.com/Rahuletto/simply-xp"
41
40
  },
42
41
  "dependencies": {
43
- "@napi-rs/canvas": "^0.1.26",
42
+ "@napi-rs/canvas": "^0.1.28",
44
43
  "chart.js": "^3.9.1",
45
44
  "mongoose": "^6.2.11"
46
45
  },
47
- "devDependencies": {
48
- "husky": "^8.0.1",
49
- "pretty-quick": "^3.1.3"
50
- },
51
46
  "peerDependencies": {
52
47
  "discord.js": "*"
53
48
  }
package/src/addLevel.js CHANGED
@@ -39,7 +39,7 @@ async function addLevel(message, userID, guildID, level) {
39
39
  }
40
40
  let level1 = user.level
41
41
 
42
- user.level += 1
42
+ user.level += parseFloat(level)
43
43
  user.xp = (user.level * 10) ** 2
44
44
 
45
45
  await user
package/src/rank.js CHANGED
@@ -98,7 +98,7 @@ async function rank(message, userID, guildID, options = []) {
98
98
  let BackgroundRadius = '20',
99
99
  BackGroundImg =
100
100
  options.background ||
101
- 'https://pinebanana.files.wordpress.com/2011/04/rainbow.jpg',
101
+ 'https://i.ibb.co/QQvMqf7/gradient.jpg',
102
102
  AttachmentName = 'rank.png',
103
103
  AttachmentDesc = 'Rank Card',
104
104
  Username = noSymbols(name),
@@ -167,42 +167,42 @@ async function rank(message, userID, guildID, options = []) {
167
167
 
168
168
  let avatar = await Canvas.loadImage(member.displayAvatarURL())
169
169
  ctx.save()
170
- RoundedBox(ctx, 40 + 30, 30, 180, 180, Number(AvatarRoundRadius))
170
+ RoundedBox(ctx, 70, 30, 180, 180, Number(AvatarRoundRadius))
171
171
  ctx.strokeStyle = BoxColor
172
- ctx.lineWidth = 10
172
+ ctx.lineWidth = 15
173
173
  ctx.stroke()
174
174
  ctx.clip()
175
- ctx.drawImage(avatar, 40 + 30, 30, 180, 180)
175
+ ctx.drawImage(avatar, 70, 30, 180, 180)
176
176
  ctx.restore()
177
177
 
178
178
  ctx.save()
179
- RoundedBox(ctx, 40 + 30, 30 + 180 + 30 + 50 + 30, 180, 50, 20)
179
+ RoundedBox(ctx, 70, 240 + 50 + 30, 180, 50, 20)
180
180
  ctx.strokeStyle = '#BFC85A22'
181
181
  ctx.stroke()
182
182
  ctx.clip()
183
183
  ctx.fillStyle = BoxColor
184
184
  ctx.globalAlpha = 1
185
- ctx.fillRect(40 + 30, 30 + 180 + 30 + 50 + 30, 180, 50)
185
+ ctx.fillRect(70, 320, 180, 50)
186
186
  ctx.globalAlpha = 1
187
187
  ctx.fillStyle = '#ffffff'
188
188
  ctx.font = '32px "Sans Serif"'
189
189
  ctx.textAlign = 'center'
190
- ctx.fillText(TextEXP, 40 + 30 + 180 / 2, 30 + 180 + 30 + 30 + 50 + 38)
190
+ ctx.fillText(TextEXP, 160, 358)
191
191
  ctx.restore()
192
192
 
193
193
  ctx.save()
194
- RoundedBox(ctx, 40 + 30, 30 + 180 + 30, 180, 50, 20)
194
+ RoundedBox(ctx, 70, 240, 180, 50, 20)
195
195
  ctx.strokeStyle = '#BFC85A22'
196
196
  ctx.stroke()
197
197
  ctx.clip()
198
198
  ctx.fillStyle = BoxColor
199
199
  ctx.globalAlpha = 1
200
- ctx.fillRect(40 + 30, 30 + 180 + 30, 180, 50, 50)
200
+ ctx.fillRect(70, 240, 180, 50, 50)
201
201
  ctx.globalAlpha = 1
202
202
  ctx.fillStyle = '#ffffff'
203
203
  ctx.font = '32px "Sans Serif"'
204
204
  ctx.textAlign = 'center'
205
- ctx.fillText(LvlText, 40 + 30 + 180 / 2, 30 + 180 + 30 + 38)
205
+ ctx.fillText(LvlText, 70 + 180 / 2, 278)
206
206
  ctx.restore()
207
207
 
208
208
  ctx.save()
@@ -224,7 +224,7 @@ async function rank(message, userID, guildID, options = []) {
224
224
  ctx.shadowOffsetX = 1
225
225
  ctx.shadowOffsetY = 1
226
226
  ctx.font = '55px "Sans Serif"'
227
- ctx.fillText('#' + Rank, canvas.width - 50 - 5, 80)
227
+ ctx.fillText('#' + Rank, canvas.width - 55, 80)
228
228
  ctx.restore()
229
229
 
230
230
  ctx.save()
@@ -235,7 +235,7 @@ async function rank(message, userID, guildID, options = []) {
235
235
  ctx.fillStyle = '#ffffff'
236
236
  ctx.font = `${fsiz} "Sans Serif"`
237
237
  ctx.textAlign = 'center'
238
- ctx.fillText(message.guild.name, 60 + 660, 355)
238
+ ctx.fillText(message.guild.name, 720, 355)
239
239
  ctx.globalAlpha = 0.2
240
240
  ctx.fillRect(390, 305, 660, 70)
241
241
  ctx.restore()
@@ -293,4 +293,4 @@ async function rank(message, userID, guildID, options = []) {
293
293
  }
294
294
  }
295
295
 
296
- module.exports = rank
296
+ module.exports = rank
package/src/roleSetup.js CHANGED
@@ -109,8 +109,8 @@ class roleSetup {
109
109
  gid: guildID
110
110
  })
111
111
 
112
- if (!rol || rol.length === 0) return
113
- rol = rol[0].lvlrole.find((item) => item.lvl === level) || undefined
112
+ if (!rol || !rol.length) return
113
+ rol = rol[0].lvlrole.filter((i) => i.lvl == level) || undefined
114
114
 
115
115
  if (rol) {
116
116
  return rol