Skip to content

Instantly share code, notes, and snippets.

@KOULIKS94
Created March 24, 2025 14:22
Show Gist options
  • Select an option

  • Save KOULIKS94/ec92153e10a2d7a5ff8e2019342bf6ff to your computer and use it in GitHub Desktop.

Select an option

Save KOULIKS94/ec92153e10a2d7a5ff8e2019342bf6ff to your computer and use it in GitHub Desktop.
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