Add /waitlist join and /waitlist leave for members, /waitlist next for the @Staff role which pings the first in line and removes them, and /waitlist show which lists positions
A queue system that lets members join and leave a line, while staff can call the next person.
Commands:
/waitlist join — Join the queue and see your position/waitlist leave — Leave the queue/waitlist show — View everyone in the queue/waitlist next — (Staff only) Ping the first person and remove them from the queueSetup: Set the staff role in the dashboard so staff can use /waitlist next.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
1. @Alex 2. @Sam 3. @Jordan
@Alex you're up! 2 remaining in queue.
1. @Jordan
@Jordan you're up! 0 remaining in queue.
The queue is empty.
// Queue system for managing member queues
mee6.settings({
staff_role: { type: 'role', label: 'Staff role (can call /waitlist next)', sample: 'Staff' },
});
/** Get the current queue. */
async function getQueue(): Promise<string[]> {
return (await mee6.store.get<string[]>('queue')) || [];
}
/** Save the queue. */
async function setQueue(queue: string[]) {
await mee6.store.set('queue', queue);
}
mee6.command('waitlist join', { description: 'Join the queue' }, async (ctx) => {
const queue = await getQueue();
if (queue.includes(ctx.author.id)) {
await ctx.reply({ content: 'You are already in the queue!', ephemeral: true });
return;
}
queue.push(ctx.author.id);
await setQueue(queue);
await ctx.reply({ content: `You joined the queue at position **#${queue.length}**.`, ephemeral: true });
});
mee6.command('waitlist leave', { description: 'Leave the queue' }, async (ctx) => {
const queue = await getQueue();
const index = queue.indexOf(ctx.author.id);
if (index === -1) {
await ctx.reply({ content: 'You are not in the queue.', ephemeral: true });
return;
}
queue.splice(index, 1);
await setQueue(queue);
await ctx.reply({ content: 'You left the queue.', ephemeral: true });
});
mee6.command('waitlist next', { description: 'Call the next person in queue (staff only)' }, async (ctx) => {
const staffRoleId = ctx.settings.staff_role;
if (!staffRoleId) {
await ctx.reply({
content: 'No staff role is set yet — an admin can choose one in the dashboard.',
ephemeral: true,
});
return;
}
if (!ctx.author.roles.includes(staffRoleId)) {
await ctx.reply({ content: 'Only staff can call the next person in queue.', ephemeral: true });
return;
}
const queue = await getQueue();
if (queue.length === 0) {
await ctx.reply({ content: 'The queue is empty.', ephemeral: true });
return;
}
const nextUserId = queue.shift()!;
await setQueue(queue);
await ctx.reply({ content: `<@${nextUserId}> you're up! ${queue.length} remaining in queue.` });
});
mee6.command('waitlist show', { description: 'Show the current queue' }, async (ctx) => {
const queue = await getQueue();
if (queue.length === 0) {
await ctx.reply({ content: 'The queue is empty.', ephemeral: true });
return;
}
const lines = queue.slice(0, 25).map((userId, i) => `**${i + 1}.** <@${userId}>`);
const more = queue.length > 25 ? `\n\n... and ${queue.length - 25} more` : '';
await ctx.reply({
embed: {
title: '📋 Queue',
description: lines.join('\n') + more,
color: '#5865f2',
footer: { text: `${queue.length} member${queue.length === 1 ? '' : 's'} in queue` },
},
ephemeral: true,
});
});