Count how many times each member says hello, and add a /hellos command showing the top 10
Tracks how many times each member says hello and shows a leaderboard.
How it works:
/hellos to see the top 10 membersThe counter increments whenever a greeting appears anywhere in a message.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
๐ฅ @Alex โ 3 hellos ๐ฅ @Jordan โ 2 hellos ๐ฅ @Sam โ 2 hellos 4. @You โ 1 hello
// Hello Counter โ tracks how many times each member says hello
// Common greetings โ only the messages containing one wake the module
const GREETINGS = ['hello', 'hi', 'hey', 'greetings', 'howdy', 'hiya', 'sup'];
// Track hello messages
mee6.on('message', { contains: GREETINGS }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const count = await m.incr('hellos', 1);
mee6.log(`${ctx.author.username} said hello (total: ${count})`);
});
// Show top 10 hello leaderboard
mee6.command(
'hellos',
{
description: 'See who says hello the most',
},
async (ctx) => {
const top = await mee6.store.memberTop('hellos', 10);
if (top.length === 0) {
await ctx.reply('No hellos recorded yet! Say hi to get started ๐');
return;
}
// Build leaderboard
const lines = top.map((entry, i) => {
const medal = i === 0 ? '๐ฅ' : i === 1 ? '๐ฅ' : i === 2 ? '๐ฅ' : `${i + 1}.`;
return `${medal} <@${entry.user_id}> โ **${entry.value}** hello${entry.value === 1 ? '' : 's'}`;
});
await ctx.reply({
embed: {
title: '๐ Hello Leaderboard',
description: lines.join('\n'),
color: '#5865F2',
footer: { text: 'Say hello to climb the ranks!' },
},
});
}
);