Add /countdown start, which announces an event in #general after a number of minutes, and /countdown cancel, which calls it off
Schedule event announcements with a countdown timer.
Commands:
/countdown start — Set a countdown with minutes and event description/countdown cancel — Cancel the active countdownSetup: Configure the announcement channel in settings (defaults to #general in test mode).
The bot will post an embed announcement when the countdown completes.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
⏰ Countdown started! I'll announce "Guild raid starting! Everyone to the voice channel." in #general in 2 minutes.
⏰ Countdown started! I'll announce "Movie night begins" in #general in 5 minutes.
⏰ Countdown cancelled.
⏰ Countdown started! I'll announce "Guild raid starting! Everyone to the voice channel." in #general in 1 minute.
Guild raid starting! Everyone to the voice channel.
// Event countdown system with start and cancel commands
mee6.settings({
channel: {
type: 'channel',
label: 'Announcement channel',
required: true,
sample: 'general',
},
});
mee6.command(
'countdown start',
{
description: 'Start a countdown to an event',
options: [
{ name: 'minutes', type: 'integer', description: 'Minutes until event', required: true },
{ name: 'event', type: 'string', description: 'What to announce', required: true },
],
},
async (ctx) => {
const minutes = ctx.option<number>('minutes');
const event = ctx.option<string>('event');
if (minutes < 1 || minutes > 525600) {
await ctx.reply('⏰ Please choose between 1 minute and 1 year (525600 minutes).');
return;
}
const seconds = minutes * 60;
if (seconds < 30) {
await ctx.reply('⏰ Minimum countdown is 30 seconds (0.5 minutes).');
return;
}
const channelId = ctx.settings.channel;
if (!channelId) {
await ctx.reply('⚙️ No announcement channel is set — ask an admin to configure one in the dashboard.');
return;
}
// Schedule the announcement
await mee6.schedule.once('countdown', seconds, {
channelId,
event,
startedBy: ctx.author.id,
});
await ctx.reply(
`⏰ Countdown started! I'll announce "${event}" in <#${channelId}> in ${minutes} minute${
minutes === 1 ? '' : 's'
}.`
);
}
);
mee6.command(
'countdown cancel',
{
description: 'Cancel the active countdown',
},
async (ctx) => {
const cancelled = await mee6.schedule.cancel('countdown');
if (cancelled) {
await ctx.reply('⏰ Countdown cancelled.');
} else {
await ctx.reply('⏰ No active countdown to cancel.');
}
}
);
mee6.on('scheduled', async (ctx) => {
if (ctx.scheduleKey === 'countdown') {
const p = ctx.payload as { channelId: string; event: string; startedBy: string } | null;
if (!p) return;
await ctx.send(p.channelId, {
embed: {
title: '⏰ Event Time!',
description: p.event,
color: '#3498db',
footer: { text: `Started by ${(await mee6.getMember(p.startedBy))?.displayName || 'Unknown'}` },
},
});
}
});