コンテンツにスキップ
Version: v1.4
目次

Breaking Changes

このコンテンツはまだ日本語訳がありません。

The v1.4 branch is the legacy line and is considered stable.

The API is the same as v1.3, so no code changes are needed to upgrade from v1.3. These are the things that can still affect you.

For the full list of changes, see the changelog.

  • Node.js 16.20.1 or newer (v1.3 worked on Node.js 14.20.1).
  • MongoDB 4.2 or newer (v1.3 worked on MongoDB 3.6).
  • discord.js ^13.12.0 or ^14.19.0.

simply-xp now uses the official mongodb driver and no longer installs mongoose. It also no longer shares or changes the mongoose connection of your own code. If your bot used mongoose through simply-xp, install it and connect it yourself.

Failed database writes now reject instead of only being logged, and connect() rejects if it cannot connect. Add a .catch (or a try/catch around await) to your calls.

connect() replaces the old one-record-per-user index with a user + server index, so a user can have XP in more than one server. The database user needs permission to create and drop indexes; the built-in readWrite role has it. Without it, the old index stays, and a user can still only have XP in one server.

If you run several processes on one database, upgrade them all together.

  • XP no longer goes below 0, and fractional levels are rounded down.
  • levelUp also fires for new users who start above level 0.
  • lvlRole() throws when the user ID or server ID is missing.
  • roleSetup.remove() also matches a level stored as "3" when given 3.
  • fetch() and leaderboard() show a billion as 1B, not 1T.

See the V2 breaking changes.