guildcreate discord.js code example
Example: discord.js guildMemberAdd
client.on('guildMemberAdd', (guildMemberAdd) => {
//Your code
});
//Note, you have to define client.
//Its best to run these events through something called a "event handler"