changelogsVersion: v1.4
On this page
Notable Versions
⚠️ Behavior Changes
Section titled “⚠️ Behavior Changes”- Failed database writes now reject instead of only being logged, and
connect()rejects if it fails. - XP no longer goes below
0, and fractional levels are rounded down. levelUpnow also fires for new users who start above level 0.lvlRole()now throws when the user ID or server ID is missing.
✅ Additions
Section titled “✅ Additions”- Add typings for
roleSetup,options,addXP({ min, max }),lvlbar,lvlbarBgand thepiechart. - Accept any
MessageorClient-shaped object in the typings, fixing TypeScript errors in ESM projects.
⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix a user only being able to have XP in one server.
connect()replaces the old index, so it needs permission to manage indexes. - Fix
addXP(),addLevel()andsetXP()for users with no record, and simultaneous calls losing XP. - Fix
levelUpfiring incorrectly, and0or negative values being mishandled. - Fix
charts()throwing when called without options. - Fix
leaderboard()withauto_purgedeleting members whose lookup only failed. - Fix a billion showing as
1Tinfetch()andleaderboard(). - Fix smaller issues in
reset(),create()androleSetup.remove().
⬆️ Dependencies
Section titled “⬆️ Dependencies”- Replace
mongoosewith the officialmongodbdriver (^6.22.0). Installmongooseyourself if you used it through simply-xp. - Remove
chart.js;charts()now draws its own charts. - Bump
@napi-rs/canvasfromv0.1.88tov1.1.1. - Limit the
discord.jspeer dependency to^13.12.0 || ^14.19.0. - Require Node.js
16.20.1and MongoDB4.2or newer (Bun1.1.39also works).
⭐ Improvements
Section titled “⭐ Improvements”- Install size drops from 28 packages / 70 MB to 15 packages / 44 MB.
- Load about 40% faster, with 40–70% faster database calls and about 35% less peak memory.
connect()takes about 10 ms longer, once. setXP()now returns{ xp, level }.- Rewrite the internals, add
npm testand replaceeslintwithoxlintandoxfmt.
💎 Design Changes
Section titled “💎 Design Changes”- Redraw
charts()with readable text on any background, the bundled font and rotating labels.
Version 1.3.8 #b52848a
Section titled “Version 1.3.8 #b52848a”⭐ Improvements
Section titled “⭐ Improvements”- Refactor leaderboard and rank position calculation into a new utility for efficiency and code reuse.
- Add a compound index to the level model for improved leaderboard query performance.
- Improve leaderboard auto-purge logic and cleaned up code style.
- Refactor
rank()image to scale background images properly, fixing stretching issues.
💎 Design Changes
Section titled “💎 Design Changes”- Replace
Baloo-Regular.ttftoBaloo2-Regular.woff2for better performance and smaller size.
⬆️ Dependencies
Section titled “⬆️ Dependencies”- Bump
@napi-rs/canvasfromv0.1.43tov0.1.88.
Version 1.3.7 #8922663
Section titled “Version 1.3.7 #8922663”⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix leaderboard not properly showing users when some have left the server.
Version 1.3.5 #02958e9
Section titled “Version 1.3.5 #02958e9”✅ Additions
Section titled “✅ Additions”⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix
charts()not properly reporting when user doesn’t havecanvasinstalled. (#9cdaf7b) - Fix
rank()not buffering image asimage/webp. (#9cdaf7b) - Fix
leaderboard()Position & Cache issues.
⬆️ Dependencies
Section titled “⬆️ Dependencies”- Bump
mongoosefrom V6 to V7. - Bump
@napi-rs/canvasfrom v0.1.28 to v0.1.41.
⭐ Improvements
Section titled “⭐ Improvements”- Improved Code Quality.
- Improved Performance.
Version 1.3.4 #5a53925
Section titled “Version 1.3.4 #5a53925”⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix
addLevel()only adding 1 level. - Fix
roleSetup.find()returning only 1 Role ID.
💎 Design Changes
Section titled “💎 Design Changes”- Update UI of
rank(), including a new default background.
Version 1.3.2 #c104afc
Section titled “Version 1.3.2 #c104afc”⬆️ Dependencies
Section titled “⬆️ Dependencies”- Replace
canvaswith@napi-rs/canvasfor better performance, and to fixnode-gypissues.
⭐ Improvements
Section titled “⭐ Improvements”- Update
rank()to use@napi-rs/canvas.
Version 1.3.0 #c773104
Section titled “Version 1.3.0 #c773104”⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix
positionnot actually working incharts(). (#72a1ac8) - Fix
addLevelnot correcting XP, and not adding specified level.
⬆️ Dependencies
Section titled “⬆️ Dependencies”- Replace
chart.js-imagewithchart.jsto remove vulnerabilities & improve performance. (#b57ad49)
⭐ Improvements
Section titled “⭐ Improvements”- Eliminate
discord.jsfunctions from being used in the package. (#72a1ac8)
Version 1.2.0 #3ea4090
Section titled “Version 1.2.0 #3ea4090”⚒️ Bug Fixes
Section titled “⚒️ Bug Fixes”- Fix
reset()not saving user sometimes. (#9ac31bc)
⬆️ Dependencies
Section titled “⬆️ Dependencies”- Bump
chart.js-imagefrom v5 to v6
⭐ Improvements
Section titled “⭐ Improvements”rank()Can now count to an undecillion! (#9ac31bc)