discord.js message on member add

Sure! Here's an example of how you can use the Discord.js library in an Ember.js application to send a message when a new member joins a server:

const Discord = require('discord.js');

module.exports = {
  name: 'guildMemberAdd',
  async execute(member) {
    const channel = member.guild.channels.cache.find(ch => ch.name === 'welcome');
    if (!channel) return;

    const embed = new Discord.MessageEmbed()
      .setDescription(`Welcome to the server, ${member}!`)


In this example, we're using the guildMemberAdd event in Discord.js to execute a function whenever a new member joins a server. Inside the function, we first find the channel with the name 'welcome' using member.guild.channels.cache.find(). If the channel doesn't exist, we simply return and do nothing.

Next, we create a new instance of Discord.MessageEmbed to create a formatted message. We set the title of the embed to 'Welcome!' and the description to a personalized welcome message using the member object. We can also set the color of the embed using the setColor() method.

Finally, we use the channel.send() method to send the embed to the 'welcome' channel.

Remember to install the discord.js package using npm or yarn before using the code above.