Give 50 coins to the author of any message that gets 5 ⭐ reactions, and only ever pay for it once
Rewards members with coins when their messages get enough ⭐ reactions.
How it works:
Configuration: Admins can adjust both settings in the dashboard:
Great for encouraging quality content and community engagement!
Made by MEE6. Remix it to get a copy of your own and change anything you like.
You have 460 coins.
// Star Rewards: Give coins when a message reaches a star threshold
mee6.settings({
threshold: {
type: 'integer',
label: 'Stars needed for reward',
default: 5,
sample: 5,
},
reward: {
type: 'integer',
label: 'Coins to reward',
default: 50,
sample: 50,
},
});
// Only star reactions wake the module
mee6.on('reaction_add', { emoji: ['⭐'] }, async (ctx) => {
const threshold = ctx.settings.threshold ?? 5;
const reward = ctx.settings.reward ?? 50;
// Fetch the message to count stars
const message = await ctx.fetchMessage();
if (!message) return;
// Don't reward bot messages
if (message.author.bot) return;
// Count how many star reactions the message has
const starCount = message.reactions?.find((r) => r.emoji === '⭐')?.count ?? 0;
// Only act when threshold is reached
if (starCount < threshold) return;
// Check if we've already paid for this message (once only)
const key = `paid_${ctx.messageId}`;
const alreadyPaid = await mee6.store.get<boolean>(key);
if (alreadyPaid) return;
// Mark as paid and give the reward
await mee6.store.set(key, true);
// The reward follows the server's Economy boosts like /work
const paid = await mee6.economy.add(message.author.id, reward, { boost: 'income' });
// React to show the reward was given
await ctx.react('💰');
mee6.log(`Rewarded ${message.author.username} ${paid.amount} coins for reaching ${starCount} stars`);
});