title: Cannot get bot to autoban new accounts on Discord
body: <p>The bot is very simple and will ultimately not require any input from me.  What I want the bot to do is to check the age of an account that joins and then ban them if they are a new account made within the past 10 minutes.  The part that I'm stuck on is calculating the time I think.  The bot isn't giving any errors, it's just not banning the new account that I made.  For testing purpose, I put the bot onto a new server I"m making that doesn't have anyone else on it and also changed the amount of time to 14400 seconds so that it's within 10 days and should give me enough time to figure out what's wrong.</p>
  
  <p>Here's my code as it stands:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Discord = require("discord.js");
  const client = new Discord.Client();
  
  client.on("ready", () =&gt; {
    console.log("I am ready!");
  });
  
  client.on("message", (message) =&gt; {
    if (message.content.startsWith("ping")) {
      message.channel.send("pong!");
    }
  });
  
  client.on("guildMemberAdd", (member) =&gt; {
      if (Date.now() - member.user.createdAt &lt;= 14400) {
          guildMember.ban({ days: 14, reason: 'New account' })
      }
  });
  
  client.login("Token");</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>member.client.user.createdAt</strong> is the section that I think I'm having a problem with.  When I run a debug on Date.now() that works fine but I can't seem to get it to calculate the age of an account that joins.</p>
  
  <p>I'm pretty sure that this is the property I need but I must be calling it incorrectly.  Please forgive any ignorance, I'm super new to js.</p>
  
  <p><a href="https://discord.js.org/#/docs/main/master/class/User?scrollTo=createdAt" rel="nofollow noreferrer">https://discord.js.org/#/docs/main/master/class/User?scrollTo=createdAt</a></p>
  
  <p>I would love to know what I'm doing wrong.  Thanks!</p>