Help with the discord bot please!

My discord is not allowing me to turn it on.

I checked versions, everything, but it is broken, again, again, and again…


intents: [Intents. FLAGS. GUILDS, Intents. FLAGS. GUILD_MEMBERS]

TypeError: Cannot read properties of undefined (reading 'FLAGS')

Node js - 18.12.1
Discord.js - 14.8

Can you help please?


const Discord = require('discord.js');
const { Intents } = require('discord.js');

const client = new Discord.Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS]

const prefix = "!";

client.on('ready', () => {
    console.log(`Logged in as ${client.user.tag}!`);
    welcomeChannel = client.channels.cache.get('#######');

// Joining Code \\
client.on('guildMemberAdd', member => {
    const embed = new Discord.MessageEmbed()
        .setTitle('Welcome to the server! 🎉')
        .setDescription(`Welcome to the official discord server, ${member}!`)
    welcomeChannel.send(embed); // Send the welcome message in the welcome channel

// Bot Login Token \\

Your code is made for v13. See

And store your token using secrets. Regenerate it through the ‘Bot’ section of your app in Discord Developer Portal

1 Like