Add /vouch which rates another member from 1 to 5 with a comment, posts it in a channel I choose, and /vouches which shows a member\'s average rating and their last three comments
A reputation system where members can vouch for each other with ratings from 1 to 5 stars and comments.
Commands:
/vouch — Rate another member with a 1-5 star rating and a comment. Posts to a designated vouch channel with the rating, comment, and running average./vouches — View any member's reputation, showing their average rating and the last 3 vouches received.Setup: Choose a vouch channel in the dashboard where all vouches will be posted. Members cannot vouch for themselves, and ratings must be between 1 and 5.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
Super helpful with server setup!
⭐⭐⭐⭐⭐ (5/5)
@You
5.00/5 (1 total)
Great trader, fast response
⭐⭐⭐⭐ (4/5)
@Jordan
4.50/5 (2 total)
Trustworthy and friendly
⭐⭐⭐⭐⭐ (5/5)
@Sam
4.67/5 (3 total)
// Vouch system: rate members and view their reputation
mee6.settings({
vouch_channel: { type: 'channel', label: 'Vouch channel', required: true, sample: 'vouches' },
});
interface Vouch {
from: string;
rating: number;
comment: string;
timestamp: number;
}
mee6.command(
'vouch',
{
description: 'Rate another member',
options: [
{ name: 'member', type: 'user', description: 'Who to vouch for', required: true },
{ name: 'rating', type: 'integer', description: 'Rating (1-5)', required: true },
{ name: 'comment', type: 'string', description: 'Your comment', required: true },
],
},
async (ctx) => {
const targetId = ctx.option<string>('member');
const rating = ctx.option<number>('rating');
const comment = ctx.option<string>('comment');
// Validation
if (targetId === ctx.author.id) {
await ctx.reply('You cannot vouch for yourself.');
return;
}
if (rating < 1 || rating > 5) {
await ctx.reply('Rating must be between 1 and 5.');
return;
}
const channelId = ctx.settings.vouch_channel;
if (!channelId) {
await ctx.reply('No vouch channel is set yet — an admin can choose one in the dashboard.');
return;
}
// Store the vouch
const targetStore = mee6.store.member(targetId);
const vouches = (await targetStore.get<Vouch[]>('vouches')) || [];
const newVouch: Vouch = {
from: ctx.author.id,
rating,
comment,
timestamp: Date.now(),
};
vouches.push(newVouch);
await targetStore.set('vouches', vouches);
// Update average rating for leaderboard
const total = vouches.reduce((sum, v) => sum + v.rating, 0);
const average = total / vouches.length;
await targetStore.set('avg_rating', Math.round(average * 100)); // Store as integer (e.g., 425 = 4.25)
// Post to vouch channel
const target = await mee6.getMember(targetId);
const stars = '⭐'.repeat(rating);
await ctx.send(channelId, {
embed: {
title: `New Vouch for ${target?.displayName || 'Unknown'}`,
description: comment,
color: '#5865f2',
fields: [
{ name: 'Rating', value: `${stars} (${rating}/5)`, inline: true },
{ name: 'From', value: ctx.author.mention, inline: true },
{ name: 'Average', value: `${average.toFixed(2)}/5 (${vouches.length} total)`, inline: true },
],
thumbnail_url: target?.avatarUrl,
},
});
await ctx.reply(`✅ Vouch posted for <@${targetId}>!`);
}
);
mee6.command(
'vouches',
{
description: "View a member's vouches",
options: [{ name: 'member', type: 'user', description: 'Who to check (defaults to you)' }],
},
async (ctx) => {
const targetId = ctx.option<string>('member', ctx.author.id);
const target = await mee6.getMember(targetId);
if (!target) {
await ctx.reply('Member not found.');
return;
}
const targetStore = mee6.store.member(targetId);
const vouches = (await targetStore.get<Vouch[]>('vouches')) || [];
if (vouches.length === 0) {
await ctx.reply({
embed: {
title: `${target.displayName}'s Vouches`,
description: 'No vouches yet.',
color: '#95a5a6',
thumbnail_url: target.avatarUrl,
},
});
return;
}
// Calculate average
const total = vouches.reduce((sum, v) => sum + v.rating, 0);
const average = total / vouches.length;
// Get last 3 vouches
const recent = vouches.slice(-3).reverse();
const fields = recent.map((v) => {
const date = new Date(v.timestamp).toLocaleDateString();
const stars = '⭐'.repeat(v.rating);
return {
name: `${stars} (${v.rating}/5) — ${date}`,
value: `${v.comment}\n*From <@${v.from}>*`,
inline: false,
};
});
await ctx.reply({
embed: {
title: `${target.displayName}'s Vouches`,
description: `**Average Rating:** ${'⭐'.repeat(Math.round(average))} ${average.toFixed(
2
)}/5\n**Total Vouches:** ${vouches.length}`,
color: '#f1c40f',
fields,
thumbnail_url: target.avatarUrl,
},
});
}
);