Give bonus XP on top of the normal Levels XP to members holding a role I choose in settings: 10 extra XP per message for @Booster and 20 for @VIP, on a one-minute cooldown per member, and /boosts which shows a member\'s current bonus
Rewards members holding specific roles with bonus XP on top of the normal Levels XP. Configure a Booster role (10 bonus XP per message) and a VIP role (20 bonus XP per message), each with a one-minute cooldown per member. Use /boosts to check your current bonus status and cooldown.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
Boost Role: VIP Bonus XP: +20 per message ⏰ Cooldown: 60s remaining
Boost Role: Booster Bonus XP: +10 per message ⏰ Cooldown: 60s remaining
Boost Role: None Bonus XP: +0 per message
Boost Role: None Bonus XP: +0 per message
// Bonus XP Boosts — members with specific roles earn extra XP per message
mee6.settings({
booster_role: {
type: 'role',
label: 'Booster role (10 bonus XP)',
required: false,
sample: 'Booster',
},
vip_role: {
type: 'role',
label: 'VIP role (20 bonus XP)',
required: false,
sample: 'VIP',
},
});
// Award bonus XP when members with boost roles send messages
mee6.on('message', async (ctx) => {
const boosterRole = ctx.settings.booster_role;
const vipRole = ctx.settings.vip_role;
// Check which role this member has (VIP takes priority)
let bonusAmount = 0;
let roleName = '';
if (vipRole && ctx.author.roles.includes(vipRole)) {
bonusAmount = 20;
roleName = 'VIP';
} else if (boosterRole && ctx.author.roles.includes(boosterRole)) {
bonusAmount = 10;
roleName = 'Booster';
}
if (bonusAmount === 0) return; // No boost role
// Check cooldown (1 minute)
const m = mee6.store.member(ctx.author.id);
const lastBoost = await m.get<number>('last_boost', 0);
const now = Math.floor(Date.now() / 1000);
if (now - lastBoost < 60) return; // Still on cooldown
// Award bonus XP and update cooldown
await mee6.xp.give(ctx.author.id, bonusAmount);
await m.set('last_boost', now);
mee6.log(`Gave ${bonusAmount} bonus XP to ${ctx.author.username} (${roleName})`);
});
// Show a member's current bonus status
mee6.command(
'boosts',
{
description: 'Check your bonus XP status',
options: [
{
name: 'user',
type: 'user',
description: 'Check another member (optional)',
required: false,
},
],
},
async (ctx) => {
const targetId = ctx.option<string>('user') || ctx.author.id;
const target = targetId === ctx.author.id ? ctx.author : await mee6.getMember(targetId);
if (!target) {
await ctx.reply('Member not found.');
return;
}
const boosterRole = ctx.settings.booster_role;
const vipRole = ctx.settings.vip_role;
// Determine current bonus
let bonusAmount = 0;
let roleName = 'None';
if (vipRole && target.roles.includes(vipRole)) {
bonusAmount = 20;
roleName = 'VIP';
} else if (boosterRole && target.roles.includes(boosterRole)) {
bonusAmount = 10;
roleName = 'Booster';
}
// Check cooldown
const m = mee6.store.member(target.id);
const lastBoost = await m.get<number>('last_boost', 0);
const now = Math.floor(Date.now() / 1000);
const timeLeft = Math.max(0, 60 - (now - lastBoost));
const cooldownText = bonusAmount > 0 && timeLeft > 0 ? `\n⏰ Cooldown: ${timeLeft}s remaining` : '';
await ctx.reply({
embed: {
title: `⚡ ${target.displayName}'s Bonus XP`,
description: `**Boost Role:** ${roleName}\n**Bonus XP:** +${bonusAmount} per message${cooldownText}`,
color: bonusAmount > 0 ? '#f1c40f' : '#95a5a6',
footer: { text: 'Bonus XP is awarded once per minute' },
},
});
}
);