Build a starboard: when a message gets 5 ⭐ reactions, repost it in #starboard as an embed with the author, the text, the image if there is one, and a link to the original
Automatically highlights the server's best messages by reposting them when they receive enough star reactions.
How it works:
Setup: Configure the starboard channel and star threshold in the creation settings.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
⭐ 5 in #general
Finally fixed the bug that ate our save files. Six hours. Never again 😅
5
// Starboard: repost messages that get enough star reactions
mee6.settings({
channel: {
type: 'channel',
label: 'Starboard channel',
required: true,
sample: 'starboard',
},
threshold: {
type: 'integer',
label: 'Stars needed',
default: 5,
sample: 5,
},
});
// Only star reactions wake the module
mee6.on('reaction_add', { emoji: ['⭐'] }, async (ctx) => {
const channelId = ctx.settings.channel;
if (!channelId) {
mee6.log('Starboard channel not configured');
return;
}
const threshold = ctx.settings.threshold ?? 5;
// Fetch the message to check reaction count and get content
const msg = await ctx.fetchMessage();
if (!msg) return;
// Count star reactions on this message
const starReaction = msg.reactions?.find((r) => r.emoji === '⭐');
if (!starReaction || starReaction.count < threshold) return;
// Check if we already posted this to starboard
const alreadyPosted = await mee6.store.get(`starboard_${msg.id}`);
if (alreadyPosted) return;
// Build the embed
const embed: any = {
color: '#ffd700',
author: {
name: msg.author.displayName,
icon_url: msg.author.avatarUrl,
},
description: msg.content || '*No text content*',
fields: [
{
name: '⭐ Stars',
value: `${starReaction.count}`,
inline: true,
},
{
name: 'Original',
value: `[Jump to message](${msg.url})`,
inline: true,
},
],
timestamp: new Date().toISOString(),
};
// Add image if present
if (msg.attachments && msg.attachments.length > 0) {
const firstImage = msg.attachments.find((a) => a.url.match(/\.(jpg|jpeg|png|gif|webp)$/i));
if (firstImage) {
embed.image_url = firstImage.url;
}
}
// Post to starboard
await ctx.send(channelId, {
content: `⭐ **${starReaction.count}** in <#${msg.channelId}>`,
embed,
});
// Mark as posted
await mee6.store.set(`starboard_${msg.id}`, true);
});