Watch a channel for messages with an image attached; when one passes five reactions, repost it in a showcase channel with the image shown, credited to its author and linking back to the original
Automatically showcases images that receive enough reactions.
How it works:
Setup: Configure three settings in the dashboard:
Each image is only showcased once, even if it continues to receive reactions.
Made by MEE6. Remix it to get a copy of your own and change anything you like.

// Reaction Showcase: reposts images that reach a reaction threshold
mee6.settings({
watch_channel: {
type: 'channel',
label: 'Channel to watch for images',
required: true,
sample: 'creations',
},
showcase_channel: {
type: 'channel',
label: 'Channel to showcase popular images',
required: true,
sample: 'showcase',
},
threshold: {
type: 'integer',
label: 'Reactions needed to showcase',
default: 5,
sample: 5,
},
});
// Only reactions in the watch channel wake the module (none while it is not set)
mee6.on('reaction_add', { channels: [mee6.setting('watch_channel')] }, async (ctx) => {
const showcaseChannel = ctx.settings.showcase_channel;
const threshold = ctx.settings.threshold ?? 5;
if (!showcaseChannel) {
return; // Settings not configured yet
}
// Fetch the message that was reacted to
const msg = await ctx.fetchMessage();
if (!msg) return;
// Check if message has image attachments
if (!msg.attachments || msg.attachments.length === 0) return;
const imageAttachment = msg.attachments.find((a) => a.url.match(/\.(jpg|jpeg|png|gif|webp)(\?|$)/i));
if (!imageAttachment) return;
// Count total reactions on the message
// We can't read reaction counts directly, so we track showcased messages
const showcaseKey = `showcased_${msg.id}`;
const alreadyShowcased = await mee6.store.get(showcaseKey);
if (alreadyShowcased) return; // Already showcased
// Check if we should showcase this message
// We'll use a simple heuristic: if this reaction brought us to threshold
// Note: We can't read exact reaction counts, so we trigger on any reaction
// after storing that we've seen enough. We'll mark it showcased immediately.
// Actually, let's track reaction count ourselves
const countKey = `reactions_${msg.id}`;
const currentCount = await mee6.store.incr(countKey);
if (currentCount >= threshold) {
// Mark as showcased first to prevent duplicates
const showcased = await mee6.store.compareAndSet(showcaseKey, null, true, { ttl: 86400 * 30 });
if (!showcased) return; // Another reaction beat us to it
// Build the showcase embed
await ctx.send(showcaseChannel, {
embed: {
title: '⭐ Showcased Image',
description: msg.content || `Posted by ${msg.author.displayName}`,
color: '#f1c40f',
image_url: imageAttachment.url,
fields: [
{
name: '👤 Author',
value: `<@${msg.author.id}>`,
inline: true,
},
{
name: '💬 Original',
value: `[Jump to message](${msg.url})`,
inline: true,
},
{
name: '⭐ Reactions',
value: `${currentCount}`,
inline: true,
},
],
footer: { text: 'Reaction Showcase' },
},
});
// Clean up the counter since we no longer need it
await mee6.store.delete(countKey);
} else {
// Set TTL on counter to auto-clean after 7 days
await mee6.store.set(countKey, currentCount, { ttl: 86400 * 7 });
}
});