Build badges: ten badges defined in the code with a name, an emoji and a description, /badge give and /badge take (staff only) award them by hand, three unlock automatically (100 messages in a channel I choose, 7 days of activity in a row, a first message with 5 reactions), and /badges shows a member\'s collection with the date each was earned
A badge system with 10 unique badges. Staff can manually award 7 badges with /badge give and remove them with /badge take. Three badges unlock automatically: Chatterbox (100 messages in a chosen channel), Consistent (7 days of activity in a row), and Popular (a message with 5 reactions). Members view their collection with /badges, showing each badge's emoji, name, description, and earned date.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
🎉 @Alex earned the 🤝 Helper badge!
1 badge
Helped another member Earned: Sep 14, 2026
🎉 @Jordan earned the 😂 Funny badge!
1 badge
Made everyone laugh Earned: Sep 14, 2026
🎉 @Alex earned the 🌟 Popular badge! (5 reactions on a message)
// Badge System — manual awards and automatic unlocks
interface Badge {
id: string;
name: string;
emoji: string;
description: string;
auto?: boolean;
}
interface BadgeEarned {
id: string;
timestamp: number;
}
// Ten badges: 7 manual, 3 automatic
const BADGES: Badge[] = [
// Manual badges
{ id: 'helper', name: 'Helper', emoji: '🤝', description: 'Helped another member' },
{ id: 'creative', name: 'Creative', emoji: '🎨', description: 'Made something cool' },
{ id: 'funny', name: 'Funny', emoji: '😂', description: 'Made everyone laugh' },
{ id: 'leader', name: 'Leader', emoji: '👑', description: 'Led an event or project' },
{ id: 'wise', name: 'Wise', emoji: '🦉', description: 'Gave great advice' },
{ id: 'friend', name: 'Friend', emoji: '💙', description: 'An amazing friend to the community' },
{ id: 'star', name: 'Star', emoji: '⭐', description: 'Staff recognition for excellence' },
// Automatic badges
{ id: 'chatter', name: 'Chatterbox', emoji: '💬', description: 'Posted 100 messages in one channel', auto: true },
{ id: 'streak', name: 'Consistent', emoji: '🔥', description: 'Active for 7 days in a row', auto: true },
{ id: 'popular', name: 'Popular', emoji: '🌟', description: 'Got 5 reactions on a message', auto: true },
];
mee6.settings({
staff_role: { type: 'role', label: 'Staff role (can give/take badges)', sample: 'Staff' },
track_channel: { type: 'channel', label: 'Channel to track for Chatterbox badge', sample: 'general' },
});
// === Commands ===
mee6.command(
'badge give',
{
description: 'Award a badge to a member',
options: [
{ name: 'member', type: 'user', description: 'Who to award', required: true },
{
name: 'badge',
type: 'string',
description: 'Which badge',
required: true,
choices: BADGES.filter((b) => !b.auto).map((b) => ({ name: `${b.emoji} ${b.name}`, value: b.id })),
},
],
},
async (ctx) => {
// Check staff permission
const staffRoleId = ctx.settings.staff_role;
if (!staffRoleId || !ctx.author.roles.includes(staffRoleId)) {
await ctx.reply({ content: 'Only staff can award badges.', ephemeral: true });
return;
}
const targetId = ctx.option<string>('member');
const badgeId = ctx.option<string>('badge');
const badge = BADGES.find((b) => b.id === badgeId);
if (!badge) {
await ctx.reply({ content: 'Badge not found.', ephemeral: true });
return;
}
// Check if already earned
const m = mee6.store.member(targetId);
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
if (earned.some((b) => b.id === badgeId)) {
await ctx.reply({
content: `<@${targetId}> already has the ${badge.emoji} **${badge.name}** badge.`,
ephemeral: true,
});
return;
}
// Award it
earned.push({ id: badgeId, timestamp: Date.now() });
await m.set('badges', earned);
await ctx.reply({
content: `🎉 <@${targetId}> earned the ${badge.emoji} **${badge.name}** badge!`,
});
}
);
mee6.command(
'badge take',
{
description: 'Remove a badge from a member',
options: [
{ name: 'member', type: 'user', description: 'Who to take from', required: true },
{
name: 'badge',
type: 'string',
description: 'Which badge',
required: true,
choices: BADGES.map((b) => ({ name: `${b.emoji} ${b.name}`, value: b.id })),
},
],
},
async (ctx) => {
// Check staff permission
const staffRoleId = ctx.settings.staff_role;
if (!staffRoleId || !ctx.author.roles.includes(staffRoleId)) {
await ctx.reply({ content: 'Only staff can remove badges.', ephemeral: true });
return;
}
const targetId = ctx.option<string>('member');
const badgeId = ctx.option<string>('badge');
const badge = BADGES.find((b) => b.id === badgeId);
if (!badge) {
await ctx.reply({ content: 'Badge not found.', ephemeral: true });
return;
}
const m = mee6.store.member(targetId);
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
const newEarned = earned.filter((b) => b.id !== badgeId);
if (newEarned.length === earned.length) {
await ctx.reply({
content: `<@${targetId}> does not have the ${badge.emoji} **${badge.name}** badge.`,
ephemeral: true,
});
return;
}
await m.set('badges', newEarned);
await ctx.reply({
content: `Removed the ${badge.emoji} **${badge.name}** badge from <@${targetId}>.`,
ephemeral: true,
});
}
);
mee6.command(
'badges',
{
description: "View a member's badge collection",
options: [{ name: 'member', type: 'user', description: 'Who to view (leave empty for yourself)' }],
},
async (ctx) => {
const targetId = ctx.option<string>('member') || ctx.author.id;
const target = await mee6.getMember(targetId);
if (!target) {
await ctx.reply({ content: 'Member not found.', ephemeral: true });
return;
}
const m = mee6.store.member(targetId);
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
if (earned.length === 0) {
await ctx.reply({
embed: {
title: `${target.displayName}'s Badges`,
description: 'No badges yet!',
color: 0x5865f2,
},
});
return;
}
// Sort by timestamp
earned.sort((a, b) => a.timestamp - b.timestamp);
const fields = earned
.map((e) => {
const badge = BADGES.find((b) => b.id === e.id);
if (!badge) return null;
const date = new Date(e.timestamp).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
});
return {
name: `${badge.emoji} ${badge.name}`,
value: `${badge.description}\n*Earned: ${date}*`,
inline: true,
};
})
.filter((f) => f !== null);
await ctx.reply({
embed: {
title: `${target.displayName}'s Badges`,
description: `**${earned.length}** badge${earned.length === 1 ? '' : 's'}`,
fields,
color: 0x5865f2,
},
});
}
);
// === Automatic unlocks ===
// 1. Chatterbox: 100 messages in the tracked channel
mee6.on('message', { channels: [mee6.setting('track_channel')] }, async (ctx) => {
const trackChannel = ctx.settings.track_channel;
const m = mee6.store.member(ctx.author.id);
const count = await m.incr('chatter_count', 1);
if (count === 100) {
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
if (!earned.some((b) => b.id === 'chatter')) {
earned.push({ id: 'chatter', timestamp: Date.now() });
await m.set('badges', earned);
const badge = BADGES.find((b) => b.id === 'chatter')!;
await ctx.send(trackChannel, {
content: `🎉 <@${ctx.author.id}> earned the ${badge.emoji} **${badge.name}** badge! (100 messages in this channel)`,
});
}
}
});
// 2. Consistent: 7 days in a row
mee6.on('message', async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const today = new Date().toDateString();
const lastActive = await m.get<string>('last_active_day');
if (lastActive !== today) {
await m.set('last_active_day', today);
const yesterday = new Date(Date.now() - 86400000).toDateString();
const currentStreak = await m.get<number>('streak', 0);
let newStreak = 1;
if (lastActive === yesterday) {
newStreak = currentStreak + 1;
}
await m.set('streak', newStreak);
if (newStreak === 7) {
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
if (!earned.some((b) => b.id === 'streak')) {
earned.push({ id: 'streak', timestamp: Date.now() });
await m.set('badges', earned);
const badge = BADGES.find((b) => b.id === 'streak')!;
await ctx.reply(`🎉 You earned the ${badge.emoji} **${badge.name}** badge! (7 days in a row)`);
}
}
}
});
// 3. Popular: 5 reactions on one message
mee6.on('reaction_add', async (ctx) => {
const msg = await ctx.fetchMessage();
if (!msg) return;
const m = mee6.store.member(msg.author.id);
const earned = (await m.get<BadgeEarned[]>('badges')) || [];
if (earned.some((b) => b.id === 'popular')) return;
// Count the reactions this creation sees on the message (one key per
// message in the global store, gone after a day — a member's own store
// holds 64 keys at most, too few for one per message).
const reactionKey = `popular_${msg.id}`;
const reactionCount = await mee6.store.incr(reactionKey, 1);
await mee6.store.set(reactionKey, reactionCount, { ttl: 86400 });
if (reactionCount >= 5) {
earned.push({ id: 'popular', timestamp: Date.now() });
await m.set('badges', earned);
const badge = BADGES.find((b) => b.id === 'popular')!;
await ctx.send(msg.channelId, {
content: `🎉 <@${msg.author.id}> earned the ${badge.emoji} **${badge.name}** badge! (5 reactions on a message)`,
});
}
});