Created
March 24, 2025 14:22
-
-
Save KOULIKS94/ec92153e10a2d7a5ff8e2019342bf6ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { bot } = require('../lib'); | |
| const userXP = {}; | |
| bot( | |
| { | |
| on: 'message', | |
| type: 'group', | |
| }, | |
| async (message) => { | |
| const user = message.sender; | |
| userXP[user] = (userXP[user] || 0) + 10; // Give 10 XP per message | |
| if (userXP[user] % 100 === 0) { // Level up every 100 XP | |
| await message.send(`🔥 *Congrats @${user.split('@')[0]}, you leveled up to Level ${userXP[user] / 100}! 🎉*`, { mentions: [user] }); | |
| } | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment