Add a /rich command showing the top 10 members by coins, with medals for the first three
Shows the top 10 richest members on the server based on MEE6 Economy coins.
Usage: /rich
The leaderboard displays:
Members are ranked by their total coin balance from the MEE6 Economy plugin.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
๐ฅ @Alex โ 410 coins ๐ฅ @Jordan โ 340 coins ๐ฅ @You โ 180 coins 4. @Quinn โ 75 coins
๐ผ You worked and earned 69 coins. You now have 144.
๐ Daily reward claimed: +112 coins. You now have 256.
๐ฅ @Alex โ 410 coins ๐ฅ @Jordan โ 340 coins ๐ฅ @Quinn โ 256 coins 4. @You โ 180 coins
๐ฅ @Alex โ 410 coins ๐ฅ @Jordan โ 340 coins ๐ฅ @Quinn โ 256 coins 4. @You โ 180 coins
๐ Daily reward claimed: +101 coins. You now have 101.
๐ฅ @Alex โ 410 coins ๐ฅ @Jordan โ 340 coins ๐ฅ @Quinn โ 256 coins 4. @You โ 180 coins 5. @Sam โ 101 coins
// Rich Leaderboard - shows the top 10 members by coins with medals
mee6.command(
'rich',
{
description: 'View the top 10 richest members',
},
async (ctx) => {
// Get the top 10 members by coins
const leaderboard = await mee6.economy.leaderboard(10);
if (leaderboard.length === 0) {
await ctx.reply('No members have any coins yet!');
return;
}
// Build the leaderboard display with medals for top 3
const medals = ['๐ฅ', '๐ฅ', '๐ฅ'];
const lines = leaderboard.map((entry, index) => {
const position = index + 1;
const medal = position <= 3 ? medals[index] : `**${position}.**`;
return `${medal} <@${entry.userId}> โ **${entry.coins}** coins`;
});
await ctx.reply({
embed: {
title: '๐ฐ Richest Members',
description: lines.join('\n'),
color: '#f1c40f',
footer: { text: 'MEE6 Economy' },
},
});
}
);