Problem with a xp system

Hello, excuse me to the person who can give me a little of their time but, I have a problem that frustrates me a little, I created a discord bot to play werewolf games, and I am currently implementing a level system.

Normally, when a player passes a level, he must see his xp reset, and make level + 1 for example: level 0 xp required 50 -> +50 xp = level 1 xp required 100.

However, I tried before changing DB, I was under .json in VSC to store my data locally, and I switched to PostgreSQL.

But the problem is the same: as soon as a player passes a level, he goes to the next level, but his xp is not reset...

Here is the xp.js event if anyone wants to help me, thanks in advance ^^

https://sourceb.in/JYKW5dk4Fb
Was this page helpful?