Every day at 6pm UTC, drop a crate in a channel I choose as an embed with a Claim button; the first three members to press it each get 100 MEE6 coins and 50 XP, the message then says who got it, and /crates shows who claimed the most this month
A daily crate to claim
Made by MEE6. Remix it to get a copy of your own and change anything you like.
All slots claimed by: @Alex, @Jordan, @Riley
๐ฅ @Alex โ 1 crate ๐ฅ @Jordan โ 1 crate ๐ฅ @Riley โ 1 crate
// Daily crate drops at 6pm UTC โ first 3 claimants get rewards
mee6.settings({
channel: { type: 'channel', label: 'Crate drop channel', required: true, sample: 'crates' },
});
// Drop a crate every day at 6pm UTC (18:00)
mee6.schedule.cron('daily_crate', '0 18 * * *');
mee6.on('scheduled', async (ctx) => {
if (ctx.scheduleKey !== 'daily_crate') return;
const channelId = ctx.settings.channel;
if (!channelId) return;
const crateId = `crate_${Date.now()}`;
const sent = await ctx.send(channelId, {
embed: {
title: '๐ฆ Daily Crate Drop!',
description: 'A crate has appeared! First **3 members** to claim get:\n\n๐ฐ **100 coins**\nโญ **50 XP**',
color: '#f39c12',
footer: { text: 'Click Claim to grab it!' },
},
buttons: [{ label: 'Claim', customId: `claim_${crateId}`, style: 'success' }],
});
// Store the crate with 3 slots, expires after 24 hours
await mee6.store.set(
crateId,
{ messageId: sent.messageId, channelId: sent.channelId, claimants: [] },
{ ttl: 86400 }
);
});
mee6.on('button', async (ctx) => {
if (!ctx.customId.startsWith('claim_crate_')) return;
const crateId = ctx.customId.replace('claim_', '');
const crate = await mee6.store.get<{ messageId: string; channelId: string; claimants: string[] }>(crateId);
if (!crate) {
await ctx.reply({ content: 'This crate has expired!', ephemeral: true });
return;
}
// Check if already claimed
if (crate.claimants.includes(ctx.author.id)) {
await ctx.reply({ content: 'You already claimed this crate!', ephemeral: true });
return;
}
// Check if full
if (crate.claimants.length >= 3) {
await ctx.reply({ content: 'This crate is already fully claimed!', ephemeral: true });
return;
}
// Add the claimant
crate.claimants.push(ctx.author.id);
await mee6.store.set(crateId, crate, { ttl: 86400 });
// Give rewards
// 100 coins, raised by the server's Economy boosts like /daily
const coins = await mee6.economy.add(ctx.author.id, 100, { boost: 'income' });
await mee6.xp.give(ctx.author.id, 50);
// Track monthly stats
const month = new Date().toISOString().slice(0, 7); // YYYY-MM
const m = mee6.store.member(ctx.author.id);
await m.incr(`crates_${month}`, 1);
await ctx.reply({ content: `โ
Claimed! You got **${coins.amount} coins** and **50 XP**!`, ephemeral: true });
// Update the embed if all 3 claimed
if (crate.claimants.length === 3) {
const claimantList = crate.claimants.map((id) => `<@${id}>`).join(', ');
await mee6.editMessage(crate.channelId, crate.messageId, {
embed: {
title: '๐ฆ Daily Crate โ Claimed!',
description: `All slots claimed by:\n${claimantList}`,
color: '#95a5a6',
footer: { text: 'Better luck tomorrow!' },
},
buttons: [],
});
}
});
mee6.command('crates', { description: 'See who claimed the most crates this month' }, async (ctx) => {
const month = new Date().toISOString().slice(0, 7);
const top = await mee6.store.memberTop(`crates_${month}`, 10);
if (top.length === 0) {
await ctx.reply('No one has claimed any crates this month yet!');
return;
}
const lines = top.map((entry, i) => {
const medal = i === 0 ? '๐ฅ' : i === 1 ? '๐ฅ' : i === 2 ? '๐ฅ' : `${i + 1}.`;
return `${medal} <@${entry.user_id}> โ **${entry.value}** crate${entry.value === 1 ? '' : 's'}`;
});
await ctx.reply({
embed: {
title: '๐ฆ Monthly Crate Leaderboard',
description: lines.join('\n'),
color: '#f39c12',
footer: { text: `${new Date().toLocaleString('en-US', { month: 'long', year: 'numeric' })}` },
},
});
});