File size: 1,673 Bytes
3c7e34b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | const { createEmbed } = require('../utils/embeds');
const { Colors } = require('../config');
/**
* Handle new member join β send a welcome embed via DM and optionally in a channel.
*/
async function handleMemberJoin(member, client) {
// Build welcome DM embed
const embed = createEmbed({
title: 'π£ Welcome to Wyvern Softworks',
description: [
`Hey **${member.user.username}**, welcome to the server!\n`,
'> Before you get started, here\'s what you need to do:\n',
'**1.** Read the πγ»rules and β οΈγ»disclaimer channels',
'**2.** Head to β
γ»verify and react to get verified',
'**3.** Once verified, the full server will unlock\n',
'```',
'π Most channels are locked until verification',
'π« Need help? Open a ticket after verifying',
'π Boost the server for exclusive perks',
'```\n',
'> Enjoy your stay β **Wyvern Softworks** π',
].join('\n'),
color: Colors.PRIMARY,
footer: 'WSB β Wyvern Softworks Bot',
});
// Try to send DM
try {
await member.send({ embeds: [embed] });
} catch {
// User has DMs disabled β silently ignore
}
}
/**
* Handle member leave (optional logging).
*/
async function handleMemberLeave(member, client) {
const { log } = require('./logger');
await log(client, {
title: 'π Member Left',
description: `**${member.user.tag}** (${member.id}) has left the server.`,
color: Colors.WARNING,
});
}
module.exports = { handleMemberJoin, handleMemberLeave };
|