Skip to content

Commit

Permalink
V2.0.0 DEV 3 FIX 2
Browse files Browse the repository at this point in the history
Fix rankCard() bug
Fix migrate.discord_xp() issues
Fix Changelog links
  • Loading branch information
Abadima committed Aug 14, 2023
1 parent 7407b17 commit c66a2c8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ yarn add simply-xp@dev
- Deleted `chart.js` dependency
- `fetch()` now also returns `position`, and accepts `username` parameter
- `roleSetup` functions now accept roleID arrays! `["role1", "role2", "role3"]`, and will return `timestamp` as a bonus!
- `reset()` function now accepts `username` and `erase` as optional arguments
- `reset()` function now accepts `erase` and `username` as optional arguments
- `addLevel(), addXP(), setLevel(), setXP()` now has a `username` parameter, to automatically create the user if it doesn't exist.

# ⚠️ V2 Breaking Changes ⚠️
Expand Down
6 changes: 6 additions & 0 deletions [email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# VERSION 2@DEV CHANGELOGS

## [DEV 3 FIX 2](https://github.com/Abadima/simply-xp/releases/tag/v2.0.0-dev.3)

### Bug Fixes

- Fix `rankCard()` creating users with incorrect parameters.

## [DEV 3 FIX 1](https://github.com/Abadima/simply-xp/releases/tag/v2.0.0-dev.3)

### Bug Fixes
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simply-xp",
"version": "2.0.0-dev.3-fix.1",
"version": "2.0.0-dev.3-fix.2",
"description": "The easiest way to implement xp system",
"main": "lib/xp.js",
"scripts": {
Expand Down Expand Up @@ -40,17 +40,16 @@
"url": "git+https://github.com/Rahuletto/simply-xp.git"
},
"dependencies": {
"@napi-rs/canvas": "^0.1.41"
"@napi-rs/canvas": "^0.1.43"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.4",
"@types/node": "^20.4.8",
"@types/node": "^20.5.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"better-sqlite3": "8.5.0",
"discord.js": "^14.12.1",
"eslint": "^8.46.0",
"guilded.ts": "^0.20.2",
"eslint": "^8.47.0",
"jsdoc-to-markdown": "^8.0.0",
"mongodb": "^5.7.0",
"typescript": "^5.1.6",
Expand Down
2 changes: 1 addition & 1 deletion src/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export async function rankCard(guild: { id: string, name: string }, user: UserOp

let dbUser = await db.findOne({collection: "simply-xps", data: {guild: guild.id, user: user.id}}) as User;
if (!dbUser) {
if (xp.auto_create) dbUser = await create(guild.id, user.id, user.username);
if (xp.auto_create) dbUser = await create(user.id, guild.id, user.username);
else throw new XpFatal({function: "rankCard()", message: "User not found in database"});
}

Expand Down
2 changes: 1 addition & 1 deletion src/functions/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export interface LevelRoleOptions {
collection: "simply-xp-levelroles";
data: {
guild: string;
level?: number;
level: number;
roles?: string | Array<string>;
timestamp: string;
};
Expand Down

0 comments on commit c66a2c8

Please sign in to comment.