Repository navigation
⚠️ 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
- 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
- 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
- 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
- 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
- Redraw
charts()with readable text on any background, the bundled font and rotating labels.
Full Changelog: v1.3.8...v1.4.0