When a member joins with a Discord account younger than 7 days, DM them why, kick them, and log it with the account creation date in a channel I choose
Automatically kicks members whose Discord accounts are too young (default: 7 days), sends them a DM explaining why, and logs each kick with the account creation date to a channel you choose.
Setup: Configure the log channel in settings.
How it works: When someone joins, their account age is checked. If it's under the threshold, they're DM'd, kicked, and logged. The minimum age can be adjusted in settings.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
Hi Sam,
Your Discord account was created on 2026-09-12, which is less than 7 days old. For security reasons, this server requires accounts to be at least 7 days old before joining.
You're welcome to try joining again once your account meets the age requirement.
/**
* Account Age Filter
* Kicks members whose Discord accounts are younger than 7 days,
* DMs them the reason, and logs the action.
*/
mee6.settings({
log_channel: {
type: 'channel',
label: 'Log channel for kicks',
required: true,
sample: 'security-logs',
},
min_age_days: {
type: 'integer',
label: 'Minimum account age in days',
default: 7,
sample: 7,
},
});
mee6.on('member_join', async (ctx) => {
const minAgeDays = ctx.settings.min_age_days ?? 7;
const logChannelId = ctx.settings.log_channel;
if (!logChannelId) {
mee6.log('Log channel not configured — ask an admin to set it in the dashboard');
return;
}
// Check account age
const accountCreated = Date.parse(ctx.author.createdAt);
const now = Date.now();
const ageMs = now - accountCreated;
const ageDays = ageMs / (1000 * 60 * 60 * 24);
if (ageDays >= minAgeDays) {
// Account is old enough
return;
}
// Account is too young — DM, kick, then log
const createdDate = new Date(accountCreated).toISOString().split('T')[0];
const dmMessage = `Hi ${ctx.author.username},
Your Discord account was created on ${createdDate}, which is less than ${minAgeDays} days old. For security reasons, this server requires accounts to be at least ${minAgeDays} days old before joining.
You're welcome to try joining again once your account meets the age requirement.`;
const dmSent = await mee6.dm(ctx.author.id, dmMessage);
// Kick the member
try {
await mee6.kick(ctx.author.id, `Account too young (${ageDays.toFixed(1)} days old)`);
} catch (err) {
mee6.log(`Failed to kick ${ctx.author.username}: ${err}`);
return;
}
// Log the action
await ctx.send(logChannelId, {
embed: {
title: '🛡️ Member Kicked — Account Too Young',
color: 0xe74c3c,
fields: [
{ name: 'Member', value: `${ctx.author.username} (${ctx.author.id})`, inline: true },
{ name: 'Account Created', value: createdDate, inline: true },
{ name: 'Age', value: `${ageDays.toFixed(1)} days`, inline: true },
{ name: 'DM Sent', value: dmSent ? 'Yes' : 'No (DMs closed)', inline: true },
],
timestamp: new Date().toISOString(),
},
});
});