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