Whenever a member levels up, post a card in a channel I choose with their avatar, their new level and a progress bar drawn by the image model, and mention them outside the embed
Posts a stylized card when members level up, showing their avatar, new level, and XP progress toward the next level. Configure which channel receives the announcements in the dashboard.
The card features:
Each member is only announced once per level-up, and the creation tracks their progress automatically.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
🎉 @Alex leveled up!

🎉 @Sam leveled up!

// Level Up Cards — posts a custom card when members level up
mee6.settings({
channel: {
type: 'channel',
label: 'Level-up announcements channel',
required: true,
sample: 'level-ups',
},
});
// MEE6 Levels: going from level n to n+1 costs 5n² + 50n + 100 XP, and
// `xp.get` returns the member's total XP — the progress bar is what is left
// above the total needed to reach the current level.
function xpToNextLevel(level: number): number {
return 5 * level * level + 50 * level + 100;
}
function totalXpForLevel(level: number): number {
let total = 0;
for (let n = 0; n < level; n++) total += xpToNextLevel(n);
return total;
}
// Levels gives XP on messages, so a level-up is seen on the next message the
// member sends: one `xp.get` per message, compared to the level remembered.
// Every run counts against the server's 60 a minute — keep it off a very
// busy server.
mee6.on('message', async (ctx) => {
const channelId = ctx.settings.channel;
if (!channelId) {
mee6.log('No channel configured for level-up cards');
return;
}
const m = mee6.store.member(ctx.author.id);
const lastLevel = await m.get<number>('last_level', -1);
const xpData = await mee6.xp.get(ctx.author.id);
if (!xpData) return;
// The first message only records where the member stands.
if (lastLevel < 0) {
await m.set('last_level', xpData.level);
return;
}
if (xpData.level > lastLevel) {
// Member leveled up!
await m.set('last_level', xpData.level);
await postCard(ctx, channelId, ctx.author, xpData);
}
});
// The same card, on demand: a member previews their own, an admin checks
// the design before the first level-up lands.
mee6.command('levelcard', { description: 'Preview your level card' }, async (ctx) => {
const channelId = ctx.settings.channel;
if (!channelId) {
await ctx.reply('No channel is configured for level-up cards yet — an admin can set one in the dashboard.');
return;
}
const xpData = await mee6.xp.get(ctx.author.id);
if (!xpData) {
await ctx.reply('No XP found for you yet.');
return;
}
await postCard(ctx, channelId, ctx.author, xpData);
await ctx.reply({ content: `Your card is in <#${channelId}>.`, ephemeral: true });
});
async function postCard(
ctx: { send: (channelId: string, payload: any) => Promise<unknown> },
channelId: string,
member: { id: string; displayName: string; avatarUrl: string; mention: string },
xpData: { xp: number; level: number }
): Promise<void> {
const xpNeeded = xpToNextLevel(xpData.level);
const xpProgress = Math.max(0, xpData.xp - totalXpForLevel(xpData.level));
const progressPercent = Math.min(100, Math.floor((xpProgress / xpNeeded) * 100));
// Draw the level-up card
const progressBarWidth = 500;
const fillWidth = Math.floor((progressBarWidth * progressPercent) / 100);
const card = await mee6.draw({
width: 800,
height: 300,
background: '#23252E',
layers: [
// Avatar circle with border
{
type: 'image',
src: member.avatarUrl,
x: 50,
y: 64,
width: 160,
height: 160,
circle: true,
border: '#5865F2',
},
// "LEVEL UP!" text
{ type: 'text', text: 'LEVEL UP!', x: 250, y: 70, size: 32, font: 'ginto', weight: 'bold', color: '#FFFFFF' },
// Member name
{
type: 'text',
text: member.displayName,
x: 250,
y: 115,
size: 40,
font: 'ginto',
weight: 'bold',
color: '#FFFFFF',
maxWidth: 520,
},
// Level number
{
type: 'text',
text: `Level ${xpData.level}`,
x: 250,
y: 165,
size: 28,
color: '#B9BBBE',
},
// Keep the XP label separate from the gauge so it stays readable at any fill.
{
type: 'text',
text: `${xpProgress} / ${xpNeeded} XP`,
x: 250,
y: 214,
size: 18,
color: '#B9BBBE',
},
{
type: 'text',
text: `Next: level ${xpData.level + 1}`,
x: 250,
y: 214,
width: progressBarWidth,
size: 18,
align: 'right',
color: '#B9BBBE',
},
// A single slim track, with rounded ends and no fill at zero XP.
{ type: 'rect', x: 250, y: 250, width: progressBarWidth, height: 12, color: '#40444B', radius: 6 },
...(fillWidth > 0
? [{ type: 'rect', x: 250, y: 250, width: fillWidth, height: 12, color: '#5865F2', radius: 6 }]
: []),
],
});
// Post the card
await ctx.send(channelId, {
content: `🎉 ${member.mention} leveled up!`,
files: [{ url: card, name: 'levelup.png' }],
embed: {
image_url: 'attachment://levelup.png',
color: 0x5865f2,
},
});
}
The pictures this example ships with. Remix it to change them or add your own.
progress_bar_fill