Build a daily word game as a /word command with subcommands: everyone gets the same five-letter word each day, /word guess opens a form to type a guess and replies with which letters are right and in the right place, six tries per member per day, /word stats shows a member's streak, which resets when they miss a day, and /word leaderboard ranks the longest streaks
A Wordle-style daily word game where everyone guesses the same five-letter word each day. You get six tries, with colored feedback showing which letters are correct and in the right position (🟩), correct but in the wrong position (🟨), or not in the word (⬜).
/word guess — Opens a form to submit your guess/word stats — View your current streak and best streak/word leaderboard — See who has the longest active streaksKeep your streak alive by solving the word every day! If you miss a day or run out of tries, your streak resets.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
Guess 1/6
⬜ P ⬜ L ⬜ A 🟨 N ⬜ T5 tries remaining.
Guess 2/6
⬜ P ⬜ L ⬜ A 🟨 N ⬜ T ⬜ A ⬜ R ⬜ I ⬜ S 🟨 E4 tries remaining.
🥇 Alex — 1 day
// Daily Word Game — everyone gets the same five-letter word each day
// Six tries per member per day, with streak tracking
// Hard-coded word list (a small set for this example; expand as needed)
const WORDS = [
'ARISE',
'PLANT',
'CRANE',
'STORM',
'LIGHT',
'BRAVE',
'FROST',
'GLOBE',
'TRACE',
'HOUSE',
'BENCH',
'SWIFT',
'PEARL',
'CROWN',
'FLAME',
'MUSIC',
'DANCE',
'STONE',
'OCEAN',
'RIDGE',
'MAPLE',
'BLADE',
'CHOIR',
'QUEST',
'ANGLE',
'PRIDE',
'WRECK',
'CHARM',
'DUSTY',
'EAGLE',
];
/** Get today's word (consistent for all members on a given day) */
function getTodaysWord(): string {
const today = new Date();
const daysSinceEpoch = Math.floor(today.getTime() / 86400000);
return WORDS[daysSinceEpoch % WORDS.length];
}
/** Get today's date as YYYY-MM-DD */
function getDateKey(): string {
const d = new Date();
return d.toISOString().split('T')[0];
}
/** Check a guess against the target word and return feedback */
function checkGuess(guess: string, target: string): string {
const g = guess.toUpperCase();
const t = target.toUpperCase();
let result = '';
for (let i = 0; i < 5; i++) {
if (g[i] === t[i]) {
result += `🟩 ${g[i]} `;
} else if (t.includes(g[i])) {
result += `🟨 ${g[i]} `;
} else {
result += `⬜ ${g[i]} `;
}
}
return result.trim();
}
/** Format guess history for display */
function formatGuesses(guesses: string[]): string {
if (guesses.length === 0) return 'No guesses yet.';
return guesses.map((g, i) => `${i + 1}. ${g}`).join('\n');
}
// Modal for submitting a guess
mee6.modal('word_guess', {
title: 'Make your guess',
fields: [{ name: 'word', label: 'Your 5-letter guess', style: 'short', maxLength: 5 }],
});
// /word guess — opens the modal
mee6.command(
'word guess',
{
description: "Guess today's word",
opens: 'word_guess',
},
async (ctx) => {
// Modal opens automatically — this handler is required but does nothing
}
);
// Handle the guess submission
mee6.on('modal', async (ctx) => {
if (ctx.customId !== 'word_guess') return;
const guess = ctx.fields.word?.trim().toUpperCase();
if (!guess || guess.length !== 5 || !/^[A-Z]{5}$/.test(guess)) {
await ctx.reply({ content: '❌ Please enter exactly 5 letters.', ephemeral: true });
return;
}
const m = mee6.store.member(ctx.author.id);
const dateKey = getDateKey();
const lastPlayed = await m.get<string>('last_played', '');
const guesses = await m.get<string[]>('guesses', []);
const target = getTodaysWord();
// Reset if it's a new day
if (lastPlayed !== dateKey) {
// Check if they missed a day (break streak)
if (lastPlayed) {
const yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
const yesterdayKey = yesterday.toISOString().split('T')[0];
if (lastPlayed !== yesterdayKey) {
// Missed at least one day — break the streak
await m.set('streak', 0);
}
}
await m.set('guesses', []);
await m.set('last_played', dateKey);
await m.set('won_today', false);
}
// Check if already won or out of tries
const wonToday = await m.get<boolean>('won_today', false);
const currentGuesses = lastPlayed === dateKey ? guesses : [];
if (wonToday) {
await ctx.reply({ content: '🎉 You already won today! Come back tomorrow for a new word.', ephemeral: true });
return;
}
if (currentGuesses.length >= 6) {
await ctx.reply({
content: `❌ You're out of tries for today. The word was **${target}**. Try again tomorrow!`,
ephemeral: true,
});
return;
}
// Process the guess
const feedback = checkGuess(guess, target);
const newGuesses = [...currentGuesses, feedback];
await m.set('guesses', newGuesses);
const won = guess === target;
if (won) {
await m.set('won_today', true);
// Update streak
const streak = await m.get<number>('streak', 0);
const newStreak = streak + 1;
await m.set('streak', newStreak);
// Track best streak
const bestStreak = await m.get<number>('best_streak', 0);
if (newStreak > bestStreak) {
await m.set('best_streak', newStreak);
}
await ctx.reply({
content: `🎉 **You got it!**\n\n${formatGuesses(newGuesses)}\n\n🔥 Streak: **${newStreak}** day${
newStreak > 1 ? 's' : ''
}`,
ephemeral: true,
});
} else if (newGuesses.length >= 6) {
// Out of tries — break streak
await m.set('streak', 0);
await ctx.reply({
content: `❌ **Out of tries!**\n\n${formatGuesses(
newGuesses
)}\n\nThe word was **${target}**. Your streak has been reset. Try again tomorrow!`,
ephemeral: true,
});
} else {
await ctx.reply({
content: `**Guess ${newGuesses.length}/6**\n\n${formatGuesses(newGuesses)}\n\n${6 - newGuesses.length} ${
newGuesses.length === 5 ? 'try' : 'tries'
} remaining.`,
ephemeral: true,
});
}
});
// /word stats — show personal stats
mee6.command(
'word stats',
{
description: 'View your word game stats',
ephemeral: true,
},
async (ctx) => {
const m = mee6.store.member(ctx.author.id);
const streak = await m.get<number>('streak', 0);
const bestStreak = await m.get<number>('best_streak', 0);
const lastPlayed = await m.get<string>('last_played', '');
const guesses = await m.get<string[]>('guesses', []);
const wonToday = await m.get<boolean>('won_today', false);
const dateKey = getDateKey();
let status = '';
if (lastPlayed === dateKey) {
if (wonToday) {
status = `✅ Solved in ${guesses.length} guess${guesses.length > 1 ? 'es' : ''}`;
} else if (guesses.length >= 6) {
status = '❌ Failed today';
} else {
status = `🔄 In progress (${guesses.length}/6 guesses)`;
}
} else {
status = '⏳ Not played yet today';
}
await ctx.reply({
embed: {
title: '📊 Your Word Game Stats',
description: `**Today:** ${status}\n**Current Streak:** 🔥 ${streak} day${
streak !== 1 ? 's' : ''
}\n**Best Streak:** ⭐ ${bestStreak} day${bestStreak !== 1 ? 's' : ''}`,
color: 0x5865f2,
},
});
}
);
// /word leaderboard — show top streaks
mee6.command(
'word leaderboard',
{
description: 'View the streak leaderboard',
ephemeral: true,
},
async (ctx) => {
const top = await mee6.store.memberTop('streak', 10);
if (top.length === 0) {
await ctx.reply({ content: 'No one has played yet!' });
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 emoji = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : `${i + 1}.`;
return `${emoji} **${name}** — ${entry.value} day${entry.value !== 1 ? 's' : ''}`;
})
);
await ctx.reply({
embed: {
title: '🏆 Streak Leaderboard',
description: lines.join('\n'),
color: 0xffd700,
footer: { text: 'Keep your streak alive by playing every day!' },
},
});
}
);