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 };