Add a /claim command members can use once a day to build a streak, which resets if they miss a day, plus a leaderboard of the longest streaks
A daily streak system where members claim once per day to build a streak counter.
Commands:
/streak claim — Claim your daily streak (once per 24 hours)/streak stats — View your current streak, longest streak, and claim status/streak leaderboard — See who has the longest streaks on the serverHow it works:
Made by MEE6. Remix it to get a copy of your own and change anything you like.
🌱 Streak claimed! You're now at 1 days in a row!
🔥 1 days
🏆 1 days
✅ Claimed today (next claim in 24h)
⏰ You already claimed today! Come back in 24h 0m.
🔥 Streak claimed! You're now at 2 days in a row!
🌱 Streak claimed! You're now at 1 days in a row!
🌱 Streak claimed! You're now at 1 days in a row!
🥇 You — 2 days 🥈 Alex — 1 days 🥉 Jordan — 1 days
🔥 2 days
🏆 2 days
✅ Claimed today (next claim in 24h)
// Daily claim streak system
const DAY_SECONDS = 86400;
mee6.command('streak claim', { description: 'Claim your daily streak' }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const now = Math.floor(Date.now() / 1000);
const lastClaim = await m.get<number>('last_claim', 0);
const currentStreak = await m.get<number>('streak', 0);
const longestStreak = await m.get<number>('longest_streak', 0);
const timeSinceLast = now - lastClaim;
// Check if already claimed today
if (timeSinceLast < DAY_SECONDS) {
const remaining = DAY_SECONDS - timeSinceLast;
const hours = Math.floor(remaining / 3600);
const minutes = Math.floor((remaining % 3600) / 60);
await ctx.reply(`⏰ You already claimed today! Come back in ${hours}h ${minutes}m.`);
return;
}
let newStreak: number;
// Check if streak continues (claimed within 48 hours)
if (timeSinceLast < DAY_SECONDS * 2) {
newStreak = currentStreak + 1;
} else {
// Streak broke, start fresh
newStreak = 1;
}
await m.set('last_claim', now);
await m.set('streak', newStreak);
// Update longest streak if needed
if (newStreak > longestStreak) {
await m.set('longest_streak', newStreak);
}
const emoji = newStreak === 1 ? '🌱' : newStreak < 7 ? '🔥' : newStreak < 30 ? '⭐' : '🏆';
if (newStreak === 1 && currentStreak > 0) {
await ctx.reply(`${emoji} Streak claimed! Your ${currentStreak}-day streak broke, starting fresh at **1 day**.`);
} else {
await ctx.reply(`${emoji} Streak claimed! You're now at **${newStreak} days** in a row!`);
}
});
mee6.command('streak leaderboard', { description: 'View the longest streaks' }, async (ctx) => {
const top = await mee6.store.memberTop('longest_streak', 10);
if (top.length === 0) {
await ctx.reply('No one has claimed a streak yet! Use `/streak claim` to start.');
return;
}
const lines = await Promise.all(
top.map(async (entry, i) => {
const member = await mee6.getMember(entry.user_id);
const name = member ? member.displayName : 'Unknown';
const medal = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : `${i + 1}.`;
return `${medal} **${name}** — ${entry.value} days`;
})
);
await ctx.reply({
embed: {
title: '🏆 Longest Streaks',
description: lines.join('\n'),
color: '#f39c12',
},
});
});
mee6.command('streak stats', { description: 'View your streak stats' }, async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const currentStreak = await m.get<number>('streak', 0);
const longestStreak = await m.get<number>('longest_streak', 0);
const lastClaim = await m.get<number>('last_claim', 0);
if (currentStreak === 0) {
await ctx.reply("You haven't started a streak yet! Use `/streak claim` to begin.");
return;
}
const now = Math.floor(Date.now() / 1000);
const timeSinceLast = now - lastClaim;
let status: string;
if (timeSinceLast < DAY_SECONDS) {
const remaining = DAY_SECONDS - timeSinceLast;
const hours = Math.floor(remaining / 3600);
status = `✅ Claimed today (next claim in ${hours}h)`;
} else if (timeSinceLast < DAY_SECONDS * 2) {
status = '⚠️ Available now — claim to continue your streak!';
} else {
status = '❌ Streak expired';
}
await ctx.reply({
embed: {
title: `${ctx.author.displayName}'s Streak`,
fields: [
{ name: 'Current Streak', value: `🔥 ${currentStreak} days`, inline: true },
{ name: 'Longest Streak', value: `🏆 ${longestStreak} days`, inline: true },
{ name: 'Status', value: status, inline: false },
],
color: '#3498db',
},
});
});