DM every new member a friendly welcome with the server rules, and give them the @Newcomer role
Welcomes new members with a friendly DM containing the server rules and automatically assigns them a newcomer role.
Configure in the Settings tab:
When someone joins the server:
If a member has DMs disabled, the role is still assigned but the DM won't be delivered.
Made by MEE6. Remix it to get a copy of your own and change anything you like.
๐ Welcome to Test server!
Welcome! Please be respectful and follow Discord's ToS.
// Settings for server-specific configuration
mee6.settings({
newcomer_role: {
type: 'role',
label: 'Newcomer role',
required: true,
sample: 'Newcomer',
},
rules: {
type: 'string',
label: 'Server rules',
default: `Welcome to the server! Please follow these rules:
1. Be respectful to all members
2. No spam or self-promotion
3. Keep content appropriate
4. Follow Discord's Terms of Service
Enjoy your stay!`,
sample: `Welcome! Please be respectful and follow Discord's ToS.`,
},
});
// Welcome new members with a DM and role assignment
mee6.on('member_join', async (ctx) => {
const roleId = ctx.settings.newcomer_role;
const rules = ctx.settings.rules;
// Send welcome DM with rules
const dmSent = await mee6.dm(ctx.author.id, `๐ **Welcome to ${ctx.guild.name}!**\n\n${rules}`);
if (!dmSent) {
mee6.log(`Could not DM ${ctx.author.username} - their DMs may be closed`);
}
// Assign the newcomer role
if (roleId) {
try {
await mee6.addRole(ctx.author.id, roleId);
mee6.log(`Assigned newcomer role to ${ctx.author.username}`);
} catch (error) {
mee6.log(`Failed to assign role to ${ctx.author.username}: ${error}`);
}
} else {
mee6.log('No newcomer role configured - skipping role assignment');
}
});