simply-xp 1.1.0 → 1.1.5-beta
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 +8 -25
- package/index.d.ts +66 -1
- package/package.json +1 -2
- package/simplyxp.js +31 -837
- package/{Fonts → src/Fonts}/Poppins-Regular.ttf +0 -0
- package/{Fonts → src/Fonts}/Poppins-SemiBold.ttf +0 -0
- package/src/addLevel.js +71 -0
- package/src/addXP.js +112 -0
- package/src/charts.js +83 -0
- package/src/connect.js +20 -0
- package/src/create.js +28 -0
- package/src/fetch.js +74 -0
- package/src/leaderboard.js +70 -0
- package/src/lvlRole.js +54 -0
- package/{models → src/models}/level.js +1 -1
- package/{models → src/models}/lvlrole.js +0 -0
- package/src/rank.js +285 -0
- package/src/reset.js +28 -0
- package/src/roleSetup.js +124 -0
- package/src/setLevel.js +71 -0
- package/src/setXP.js +51 -0
package/README.md
CHANGED
|
@@ -30,10 +30,12 @@ yarn add simply-xp
|
|
|
30
30
|
|
|
31
31
|
# 🎉 What's New 🎉
|
|
32
32
|
|
|
33
|
-
- Fixed
|
|
34
|
-
- New `
|
|
35
|
-
-
|
|
36
|
-
- New
|
|
33
|
+
- Fixed bugs
|
|
34
|
+
- New `addLevel(), setLevel(), reset()`
|
|
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
|
|
37
39
|
- Bug Fixes
|
|
38
40
|
|
|
39
41
|
# But Why ?
|
|
@@ -44,28 +46,9 @@ yarn add simply-xp
|
|
|
44
46
|
- Beginner Friendly
|
|
45
47
|
- Easier than other XP Systems
|
|
46
48
|
- Inbuilt Auto Roles system
|
|
49
|
+
- Flexible and simple at the same time
|
|
47
50
|
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
# 🖥 Functions 🖥
|
|
51
|
-
|
|
52
|
-
```js
|
|
53
|
-
let xp = require('simply-xp')
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
- [connect()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/connect.md)
|
|
57
|
-
- [create()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/create.md)
|
|
58
|
-
- [addXP()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/addXP.md)
|
|
59
|
-
- [setXP()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/setXP.md)
|
|
60
|
-
- [rank()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/rank.md)
|
|
61
|
-
- [fetch()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/fetch.md)
|
|
62
|
-
- [leaderboard()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/leaderboard.md)
|
|
63
|
-
- [lvlRole()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/lvlRole.md) | Requires: [roleSetup()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/roleSetup.md)
|
|
64
|
-
- [roleSetup()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/roleSetup.md) | Requires: [lvlRole()](https://github.com/Rahuletto/simply-xp/blob/main/Examples/lvlRole.md)
|
|
65
|
-
|
|
66
|
-
Overwhelmed by these functions ?? Got ya covered !
|
|
67
|
-
|
|
68
|
-
- [Introduction](https://github.com/Rahuletto/simply-xp/blob/main/Examples/intro.md)
|
|
51
|
+
`Reconstructed discord-xp to give you things simpler ;)`
|
|
69
52
|
|
|
70
53
|
<br>
|
|
71
54
|
|
package/index.d.ts
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import { Message } from 'discord.js'
|
|
1
|
+
import { Message, Client } from 'discord.js'
|
|
2
2
|
|
|
3
3
|
type HexColorString = `#${string}` | string
|
|
4
4
|
|
|
5
5
|
export type connectOptions = {
|
|
6
6
|
notify?: boolean
|
|
7
7
|
}
|
|
8
|
+
|
|
8
9
|
export declare function connect(
|
|
9
10
|
db: string,
|
|
10
11
|
options?: connectOptions
|
|
11
12
|
): Promise<any>
|
|
12
13
|
|
|
14
|
+
export declare function addLevel(
|
|
15
|
+
message: Message,
|
|
16
|
+
userID: string,
|
|
17
|
+
guildID: string,
|
|
18
|
+
level: number
|
|
19
|
+
): Promise<any>
|
|
20
|
+
|
|
21
|
+
export declare function addXP(
|
|
22
|
+
message: Message,
|
|
23
|
+
userID: string,
|
|
24
|
+
guildID: string,
|
|
25
|
+
xp: number
|
|
26
|
+
): Promise<any>
|
|
27
|
+
|
|
13
28
|
export type chartsOptions = {
|
|
14
29
|
position?: string
|
|
15
30
|
background?: HexColorString
|
|
@@ -21,6 +36,22 @@ export declare function charts(
|
|
|
21
36
|
options?: chartsOptions
|
|
22
37
|
): Promise<any>
|
|
23
38
|
|
|
39
|
+
export declare function create(userID: string, guildID: string): Promise<any>
|
|
40
|
+
|
|
41
|
+
export declare function fetch(userID: string, guildID: string): Promise<any>
|
|
42
|
+
|
|
43
|
+
export declare function leaderboard(
|
|
44
|
+
userID: string,
|
|
45
|
+
guildID: string,
|
|
46
|
+
limit: number
|
|
47
|
+
): Promise<any>
|
|
48
|
+
|
|
49
|
+
export declare function lvlRole(
|
|
50
|
+
message: Message,
|
|
51
|
+
userID: string,
|
|
52
|
+
guildID: string
|
|
53
|
+
): Promise<any>
|
|
54
|
+
|
|
24
55
|
export type rankOptions = {
|
|
25
56
|
slash?: boolean
|
|
26
57
|
background?: string
|
|
@@ -33,6 +64,8 @@ export declare function rank(
|
|
|
33
64
|
options?: rankOptions
|
|
34
65
|
): Promise<any>
|
|
35
66
|
|
|
67
|
+
export declare function reset(userID: string, guildID: string): Promise<any>
|
|
68
|
+
|
|
36
69
|
export type lvladdOptions = {
|
|
37
70
|
level: string
|
|
38
71
|
role: string
|
|
@@ -40,3 +73,35 @@ export type lvladdOptions = {
|
|
|
40
73
|
export type lvlremoveOptions = {
|
|
41
74
|
level: string
|
|
42
75
|
}
|
|
76
|
+
|
|
77
|
+
export declare function setLevel(
|
|
78
|
+
message: Message,
|
|
79
|
+
userID: string,
|
|
80
|
+
guildID: string,
|
|
81
|
+
level: number
|
|
82
|
+
): Promise<any>
|
|
83
|
+
|
|
84
|
+
export declare function setXP(
|
|
85
|
+
userID: string,
|
|
86
|
+
guildID: string,
|
|
87
|
+
xp: number
|
|
88
|
+
): Promise<any>
|
|
89
|
+
|
|
90
|
+
/** For levelUp event */
|
|
91
|
+
export type Data = {
|
|
92
|
+
xp: string
|
|
93
|
+
level: number
|
|
94
|
+
userID: string
|
|
95
|
+
guildID: string
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type Role = {
|
|
99
|
+
lvl: string
|
|
100
|
+
role: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare module 'discord.js' {
|
|
104
|
+
export interface ClientEvents {
|
|
105
|
+
levelUp: [Message, Data, Role]
|
|
106
|
+
}
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simply-xp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-beta",
|
|
4
4
|
"description": "A Simple, Easy and Beginner Friendly XP System",
|
|
5
5
|
"main": "simplyxp.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"canvas": "^2.8.0",
|
|
44
44
|
"chart.js-image": "^5.6.3",
|
|
45
|
-
"discord.js": "^13.3.0",
|
|
46
45
|
"mongoose": "^6.0.12"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|