level-system-phoenix
Version:
Ein Levelsystem für WhatsApp Bots mit Baileys und Command-Handlern inklusive Cheat-Schutz, XP, Ränge und Speicher.
10 lines • 344 B
JavaScript
/**
* Event-Handler: Vergibt XP, wenn ein Command erkannt wird.
*/
module.exports = (levelSystem, userId) => {
const now = Math.floor(Date.now() / 1000);
const user = levelSystem.storage.getUser(userId);
const result = levelSystem.logic.processXP(user, now);
levelSystem.storage.updateUser(userId, user);
return result;
};