Give the @Member role 10 minutes after someone joins, and kick anyone still without the @Verified role 24 hours after joining, logging both in #mod-logs
Automatically manages member roles and verification:
Configure the three required settings in the dashboard: Member role, Verified role, and Mod logs channel. Kicks are off by default; a check scheduled before a role setting changed is skipped rather than enforced.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
@Sam received the @Member role
@Jordan received the @Member role
@Sam successfully verified within 24 hours
@Jordan was kicked for not having the @Verified role within 24 hours
// Auto-role and verification system
// - Gives @Member role 10 minutes after joining
// - 24 hours after joining, checks for the @Verified role: logs who never
// verified, and kicks them only when "Kick unverified members" is on
// - Logs all actions to mod logs channel
//
// Safe by default: kicks are off until the server turns them on, and a
// check scheduled under one set of roles is not enforced under another —
// changing the Verified role after members joined must not get them kicked
// for lacking a role that did not exist when their clock started.
mee6.settings({
member_role: {
type: 'role',
label: 'Member role to grant after 10 minutes',
required: true,
sample: 'Member',
},
verified_role: {
type: 'role',
label: 'Verified role required within 24 hours',
required: true,
sample: 'Verified',
},
mod_logs: {
type: 'channel',
label: 'Moderation logs channel',
required: true,
sample: 'mod-logs',
},
kick_unverified: {
type: 'boolean',
label: 'Kick unverified members (otherwise only log them)',
description:
'Off by default: the 24-hour check only posts who never verified. Turn it on once the roles are right.',
default: false,
sample: true,
},
});
interface Pending {
userId: string;
username: string;
action: 'grant_member' | 'check_verified';
/** the role the check was scheduled for — a different one now means the setup changed */
roleId: string;
}
mee6.on('member_join', async (ctx) => {
const memberRole = ctx.settings.member_role;
const verifiedRole = ctx.settings.verified_role;
const modLogs = ctx.settings.mod_logs;
if (!memberRole || !verifiedRole || !modLogs) {
mee6.log('Settings not configured: member_role, verified_role, or mod_logs missing');
return;
}
// Schedule: give @Member role after 10 minutes (600 seconds)
const grant: Pending = {
userId: ctx.author.id,
username: ctx.author.username,
action: 'grant_member',
roleId: String(memberRole),
};
await mee6.schedule.once(`member_${ctx.author.id}`, 600, grant);
// Schedule: check for @Verified role after 24 hours (86400 seconds)
const check: Pending = {
userId: ctx.author.id,
username: ctx.author.username,
action: 'check_verified',
roleId: String(verifiedRole),
};
await mee6.schedule.once(`verify_${ctx.author.id}`, 86400, check);
});
mee6.on('scheduled', async (ctx) => {
if (!ctx.payload) return;
const p = ctx.payload as Pending;
const memberRole = ctx.settings.member_role;
const verifiedRole = ctx.settings.verified_role;
const modLogs = ctx.settings.mod_logs;
const kickUnverified = Boolean(ctx.settings.kick_unverified);
if (!memberRole || !verifiedRole || !modLogs) {
mee6.log('Settings not configured during scheduled event');
return;
}
if (p.action === 'grant_member') {
if (p.roleId && p.roleId !== String(memberRole)) {
// The Member role changed since this member joined: granting the new
// one was never decided for them. Say so rather than guess.
mee6.log(`Skipped the Member role for ${p.userId}: the role setting changed since they joined`);
return;
}
// Grant @Member role after 10 minutes
try {
const member = await mee6.getMember(p.userId);
if (!member) {
mee6.log(`Member ${p.userId} not found (probably left)`);
return;
}
await mee6.addRole(p.userId, memberRole);
await ctx.send(modLogs, {
embed: {
title: '✅ Member Role Granted',
description: `<@${p.userId}> received the <@&${memberRole}> role`,
color: 0x57f287,
timestamp: new Date().toISOString(),
footer: { text: `User ID: ${p.userId}` },
},
});
} catch (error) {
mee6.log(`Failed to grant member role: ${error}`);
}
} else if (p.action === 'check_verified') {
if (p.roleId && p.roleId !== String(verifiedRole)) {
// The Verified role changed since this check was scheduled. Enforcing
// the new role on someone whose clock started under the old one would
// kick people for a rule they never had; the check is dropped and the
// drop is logged.
mee6.log(`Skipped the verification check for ${p.userId}: the Verified role setting changed since they joined`);
await ctx.send(modLogs, {
embed: {
title: '⏭️ Verification Check Skipped',
description:
`<@${p.userId}>'s 24-hour check was scheduled for a different Verified role than the one ` +
`configured now (<@&${verifiedRole}>). Nothing was done.`,
color: 0xfee75c,
timestamp: new Date().toISOString(),
footer: { text: `User ID: ${p.userId}` },
},
});
return;
}
// Check if member has @Verified role; kick only when the server opted in
try {
const member = await mee6.getMember(p.userId);
if (!member) {
mee6.log(`Member ${p.userId} not found (probably already left)`);
return;
}
if (member.roles.includes(verifiedRole)) {
// Member is verified, log success
await ctx.send(modLogs, {
embed: {
title: '✅ Member Verified',
description: `<@${p.userId}> successfully verified within 24 hours`,
color: 0x57f287,
timestamp: new Date().toISOString(),
footer: { text: `User ID: ${p.userId}` },
},
});
return;
}
if (!kickUnverified) {
// Log-only mode, the default: the moderators see who never
// verified and decide themselves.
await ctx.send(modLogs, {
embed: {
title: '⚠️ Member Not Verified',
description:
`<@${p.userId}> has not received the <@&${verifiedRole}> role within 24 hours. ` +
'Not kicked: "Kick unverified members" is off in the creation settings.',
color: 0xfee75c,
timestamp: new Date().toISOString(),
footer: { text: `User ID: ${p.userId}` },
},
});
return;
}
await mee6.kick(p.userId, 'Failed to verify within 24 hours');
await ctx.send(modLogs, {
embed: {
title: '🚫 Member Kicked - Not Verified',
description: `<@${p.userId}> was kicked for not having the <@&${verifiedRole}> role within 24 hours`,
color: 0xed4245,
timestamp: new Date().toISOString(),
footer: { text: `User ID: ${p.userId}` },
},
});
} catch (error) {
mee6.log(`Failed to check verification: ${error}`);
}
}
});