Add a /remindme command that takes a text and a number of minutes, then pings me with that text in the same channel when the time is up
Set personal reminders that ping you after a delay.
/remindme text:"Buy milk" minutes:30 — schedules a ping in 30 minutesMade by MEE6. Remix it to get a copy of your own and change anything you like.
⏰ Got it! I'll remind you in 2 minutes.
⏰ Got it! I'll remind you in 5 minutes.
⏰ Got it! I'll remind you in 1 minute.
@Jordan ⏰ Reminder: Post announcement
@You ⏰ Reminder: Check server applications
// Personal reminders — schedule a ping with custom text
mee6.command(
'remindme',
{
description: 'Set a personal reminder',
options: [
{ name: 'text', type: 'string', description: 'What to remind you about', required: true },
{ name: 'minutes', type: 'integer', description: 'Minutes from now (min 1, max 525600)', required: true },
],
},
async (ctx) => {
const text = ctx.option<string>('text');
const minutes = ctx.option<number>('minutes');
// Validate range: at least 0.5 minutes (30s floor), at most 1 year
if (minutes < 1) {
await ctx.reply('⏰ Minutes must be at least 1.');
return;
}
if (minutes > 525600) {
await ctx.reply('⏰ Minutes cannot exceed 1 year (525,600 minutes).');
return;
}
const seconds = minutes * 60;
const key = `remind_${ctx.author.id}_${Date.now()}`;
await mee6.schedule.once(key, seconds, {
channelId: ctx.channelId,
userId: ctx.author.id,
text: text,
});
await ctx.reply(`⏰ Got it! I'll remind you in ${minutes} minute${minutes === 1 ? '' : 's'}.`);
}
);
mee6.on('scheduled', async (ctx) => {
if (ctx.scheduleKey.startsWith('remind_')) {
const p = ctx.payload as { channelId: string; userId: string; text: string };
if (!p) return; // guard against missing payload
await ctx.send(p.channelId, `<@${p.userId}> ⏰ **Reminder:** ${p.text}`);
}
});