cardboardbox/events/guildMemberAdd.js

8 lines
348 B
JavaScript
Raw Normal View History

module.exports = (client, member) => {
const settings = client.getSettings(member.guild);
if (settings.welcomeEnabled !== "true") return;
const welcomeMessage = settings.welcomeMessage.replace("{{user}}", member.user.tag);
member.guild.channels.find(c => c.name === settings.welcomeChannel).send(welcomeMessage).catch(console.error);
};