title: discord.js event handler welcome message
body: <p>so I made an event handler for my discord bot so that the index.js file would be neat. But for some reason the welcome message that I made whenever someone joins the server doesn't work.</p>
  <p>Here's my event handler code:</p>
  <pre><code>const eventFiles = fs.readdirSync('./events').filter(file =&gt; file.endsWith('.js'));
  
  for (const file of eventFiles) {
      const event = require(`./events/${file}`);
      if (event.once) {
          client.once(event.name, (...args) =&gt; event.execute(...args, Discord, client));
      } else {
          client.on(event.name, (...args) =&gt; event.execute(...args, Discord, client));
      }
  }
  
  </code></pre>
  <p>And Here's my welcome message code:</p>
  <pre><code>module.exports =  {
      name: 'welcome',
      once: false,
      execute(Discord, client) {
  
      const welcomechannelId = '753484351882133507' //Channel You Want to Send The Welcome Message
      const targetChannelId = `846341557992292362` //Channel For Rules
  
          client.on('guildMemberAdd', (member) =&gt; {
              let welcomeRole = member.guild.roles.cache.find(role =&gt; role.name === 'Umay');
              member.roles.add(welcomeRole);
  
              const channel = member.guild.channels.cache.get(welcomechannelId)
  
              const WelcomeEmbed = new Discord.MessageEmbed()
              .setTitle(`Welcome To ${member.guild.name}`)
              .setThumbnail(member.user.displayAvatarURL({dynamic: true, size: 512}))
              .setDescription(`Hello &lt;@${member.user.id}&gt;, Welcome to **${member.guild.name}**. Thanks For Joining Our Server.
  Please Read ${member.guild.channels.cache.get(targetChannelId).toString()}, and assign yourself some roles at &lt;#846341532520153088&gt;. You can chat in &lt;#753484351882133507&gt; and talk with other people.`)
           // You Can Add More Fields If You Want
              .setFooter(`Welcome ${member.user.username}#${member.user.discriminator}`,member.user.displayAvatarURL({dynamic: true, size: 512}))
              .setColor('RANDOM')
          member.guild.channels.cache.get(welcomechannelId).send(WelcomeEmbed)
          
      })
  
      }
  }
  </code></pre>
  <p>I get no error, but whenever someone joins the server, he/she won't be given the role and the welcome message doesn't appear. I put the welcome message code on an events folder that the event handler is handling. Can anyone help?</p>