Add a staff applications panel: /applications panel posts a card listing the open positions I configure, each with its description and its own Apply button, and /apply opens the same form — why the member wants to join the staff and how old they are. Post each application with the position in a channel I choose with Accept and Reject buttons, and DM the applicant the decision
A staff application system with a panel listing your open positions.
Setup: choose the review channel and list your open positions (name and a line about each) in the settings, then post the panel with /applications panel.
How it works:
/apply opens the same form without a positionMade by MEE6. Remix it to get a copy of your own and change anything you like.
Want to help run the server? Pick a position and tell us why.
🛡️ Moderator Keep the chat friendly and the rules respected
🤝 Helper Welcome newcomers and answer their questions
🎉 Event host Run game nights, contests and giveaways
The staff read every application. You get the answer by DM.
✅ Your application has been submitted! You will receive a DM with the decision.
✏️ Your application was updated.
// Staff application system: a panel with one Apply button per open position, a modal form,
// a review card with Accept/Reject buttons, and DM notifications
const BLURPLE = 0x5865f2;
const GREEN = 0x57f287;
const RED = 0xed4245;
// How many positions a panel lists, one Apply button each
const MAX_POSITIONS = 5;
mee6.settings({
applications_channel: {
type: 'channel',
label: 'Applications review channel',
description: 'Where staff applications are posted for review',
required: true,
sample: 'staff-applications',
},
reviewer_role: {
type: 'role',
label: 'Who decides on applications',
description:
'Only members with this role can press Accept or Reject. Left empty, anyone who can see the review channel can.',
required: false,
sample: 'Staff',
},
positions: {
type: 'list',
label: 'Open positions',
description: 'Listed on the panel, one Apply button each. Post the panel again after changing them.',
required: false,
maxItems: MAX_POSITIONS,
fields: {
name: { type: 'string', label: 'Position', required: true },
description: { type: 'string', label: 'What the role is about', required: false },
},
default: [
{ name: '🛡️ Moderator', description: 'Keep the chat friendly and the rules respected' },
{ name: '🤝 Helper', description: 'Welcome newcomers and answer their questions' },
{ name: '🎉 Event host', description: 'Run game nights, contests and giveaways' },
],
},
});
const FORM_FIELDS: ModalField[] = [
{
name: 'why',
label: 'Why do you want to join the staff team?',
style: 'paragraph',
maxLength: 1000,
required: true,
},
{
name: 'age',
label: 'How old are you?',
style: 'short',
maxLength: 3,
required: true,
},
];
// Modal form for the application: /apply and every Apply button on the panel open it
mee6.modal('apply', { title: 'Staff application', fields: FORM_FIELDS });
interface Position {
name: string;
description?: string;
}
function positions(settings: Record<string, StoredValue>): Position[] {
return ((settings.positions ?? []) as Position[]).filter((p) => p && p.name).slice(0, MAX_POSITIONS);
}
interface Application {
userId: string;
username: string;
why: string;
age: string;
/** the position applied for — absent from /apply and from applications sent before the panel */
position?: string;
}
/** Where a member's application waiting for a decision is: its review card */
interface PendingApplication {
messageId: string;
channelId: string;
}
/** A Discord timestamp: each member reads it in their own time zone */
function timestamp(): string {
return `<t:${Math.floor(Date.now() / 1000)}:f>`;
}
/** The review card: the answers as labelled lines, the decision once there is one */
function reviewCard(app: Application, decision?: { action: 'accept' | 'reject'; by: string }): LayoutBlock[] {
const title = !decision
? '## 📋 New staff application'
: decision.action === 'accept'
? '## ✅ Application accepted'
: '## ❌ Application rejected';
const blocks: LayoutBlock[] = [
{ type: 'text', text: app.position ? `${title}\nfor **${app.position}**` : title },
{ type: 'separator' },
{ type: 'text', text: `**👤 Applicant**\n<@${app.userId}> (${app.username})` },
{ type: 'text', text: `**❓ Why do you want to join?**\n${app.why}` },
{ type: 'text', text: `**🎂 Age**\n${app.age}` },
];
if (decision) {
blocks.push({ type: 'text', text: `**⚖️ Decision by**\n<@${decision.by}>` });
} else {
blocks.push({
type: 'buttons',
buttons: [
{ label: 'Accept', customId: `accept_${app.userId}`, style: 'success' },
{ label: 'Reject', customId: `reject_${app.userId}`, style: 'danger' },
],
});
}
blocks.push({ type: 'text', text: `-# User ID: ${app.userId} · ${timestamp()}` });
const color = !decision ? BLURPLE : decision.action === 'accept' ? GREEN : RED;
return [{ type: 'container', color, blocks }];
}
// Command that opens the application form
// Commands with `opens` still need an empty handler
mee6.command('apply', { description: 'Apply to join the staff team', opens: 'apply' }, async (ctx) => {
// The modal opens immediately; no code runs here
});
// Admin command: post the applications panel, one line and one Apply button per position
mee6.command('applications panel', { description: 'Post the staff applications panel' }, async (ctx) => {
const open = positions(ctx.settings);
const rows: LayoutBlock[] = open.length
? open.map((position, i) => ({
type: 'section',
text: position.description ? `**${position.name}**\n${position.description}` : `**${position.name}**`,
// Its own customId says which position: the form gets it as ctx.openedBy
button: { label: 'Apply', opens: 'apply', customId: `position:${i}`, style: 'primary' },
}))
: [
{
type: 'section',
text: '**Staff team**\nHelp us run the server.',
button: { label: 'Apply', opens: 'apply', style: 'primary' },
},
];
await ctx.reply({
layout: [
{
type: 'container',
color: BLURPLE,
blocks: [
{
type: 'text',
text: '## 📋 Staff applications\nWant to help run the server? Pick a position and tell us why.',
},
{ type: 'separator' },
...rows,
{ type: 'separator' },
{ type: 'text', text: '-# The staff read every application. You get the answer by DM.' },
],
},
],
});
});
// Handle the submitted application
mee6.on('modal', async (ctx) => {
if (ctx.customId !== 'apply') return;
const channelId = ctx.settings.applications_channel;
if (!channelId) {
await ctx.reply({
content: 'Applications are not set up yet. Please contact an administrator.',
ephemeral: true,
});
return;
}
const mine = mee6.store.member(ctx.author.id);
// The member edited a pending application (the Edit button below): its
// card is rewritten, nothing new is posted
const editing = await mine.get<PendingApplication>('editing');
if (editing) {
await mine.delete('editing');
const app = await mee6.store.get<Application>(`app_${editing.messageId}`);
if (!app) {
await ctx.reply({
content: 'Your application was already reviewed — it can no longer be changed.',
ephemeral: true,
});
return;
}
app.why = ctx.fields.why as string;
app.age = ctx.fields.age as string;
await mee6.store.set(`app_${editing.messageId}`, app, { ttl: 2592000 });
await mee6.editMessage(editing.channelId, editing.messageId, { layout: reviewCard(app) });
await ctx.reply({ content: '✏️ Your application was updated.', ephemeral: true });
return;
}
const app: Application = {
userId: ctx.author.id,
username: ctx.author.username,
why: ctx.fields.why as string,
age: ctx.fields.age as string,
};
// The panel's Apply button that opened the form, if any: `position:2` is the third position
const fromPanel = /^position:(\d+)$/.exec(ctx.openedBy ?? '');
const position = fromPanel ? positions(ctx.settings)[Number(fromPanel[1])] : undefined;
if (position) app.position = position.name;
// Post to review channel with Accept/Reject buttons
const sent = await ctx.send(channelId, { layout: reviewCard(app) });
// Store the application data for later reference, and which one is the member's
await mee6.store.set(`app_${sent.messageId}`, app, { ttl: 2592000 }); // 30 days
await mine.set('pending', { messageId: sent.messageId, channelId: sent.channelId }, { ttl: 2592000 });
// Confirm to the applicant, who may still change their answers until the staff decide
await ctx.reply({
content: '✅ Your application has been submitted! You will receive a DM with the decision.',
ephemeral: true,
buttons: [{ label: 'Edit my application', customId: 'edit_application', style: 'secondary' }],
});
});
// Edit a pending application: the same form, opened from code with the answers
// already filled in — `ctx.openModal` comes first, before anything else answers
mee6.on('button', async (ctx) => {
if (ctx.customId !== 'edit_application') return;
const mine = mee6.store.member(ctx.author.id);
const pending = await mine.get<PendingApplication>('pending');
const app = pending ? await mee6.store.get<Application>(`app_${pending.messageId}`) : null;
if (!pending || !app) {
await ctx.reply({
content: 'Your application was already reviewed — it can no longer be changed.',
ephemeral: true,
});
return;
}
await ctx.openModal('apply', {
title: 'Edit your application',
fields: { why: { value: app.why }, age: { value: app.age } },
});
// What the submit is: an edit of this application, not a new one
await mine.set('editing', pending, { ttl: 3600 });
});
// Handle Accept/Reject button clicks
mee6.on('button', async (ctx) => {
if (!ctx.customId.startsWith('accept_') && !ctx.customId.startsWith('reject_')) return;
// Anyone who sees the card can press its buttons: the reviewer role says
// who decides, whoever posted the card
const reviewer = ctx.settings.reviewer_role as string | null;
if (reviewer && !ctx.author.roles.includes(reviewer)) {
await ctx.reply({ content: `Only <@&${reviewer}> can decide on an application.`, ephemeral: true });
return;
}
const action = ctx.customId.startsWith('accept_') ? 'accept' : 'reject';
const userId = ctx.customId.replace(/^(accept|reject)_/, '');
// Get the application data
const appData = await mee6.store.get<Application>(`app_${ctx.message.id}`);
if (!appData) {
await ctx.reply({
content: '❌ Application data not found. It may have expired.',
ephemeral: true,
});
return;
}
// Update the review message to show the decision, without the buttons —
// an application posted before the cards were becomes one too
await ctx.editOriginal({ layout: reviewCard(appData, { action, by: ctx.author.id }) });
// DM the applicant
const role = appData.position ? ` for **${appData.position}**` : '';
const dmSent = await mee6.dm(
userId,
action === 'accept'
? `✅ **Congratulations!** Your staff application${role} has been accepted. Welcome to the team! A staff member will contact you soon with next steps.`
: `❌ Thank you for applying to the staff team${role}. Unfortunately, your application has been rejected at this time. You're welcome to apply again in the future.`
);
// Confirm to the reviewer
await ctx.reply({
content: dmSent
? `✅ Application ${action}ed and applicant notified via DM.`
: `✅ Application ${action}ed, but the applicant's DMs are closed.`,
ephemeral: true,
});
// Clean up the stored data: decided, the application can no longer be edited
await mee6.store.delete(`app_${ctx.message.id}`);
await mee6.store.member(userId).delete('pending');
});