Cannot read properties of undefined (reading 'FLAGS')
What you see
TypeError: Cannot read properties of undefined (reading 'FLAGS')
Why it happens
Intents.FLAGS is discord.js v13. Version 14 (July 2022) replaced it with GatewayIntentBits, and npm install gives you v14.
The fix
- rightsocket does this Rewrites Intents.FLAGS.GUILDS and the rest as GatewayIntentBits.Guilds and so on, and updates the require line.
What changed, and when
- July 2022, discord.js: discord.js v14: Intents became GatewayIntentBits, MessageEmbed became EmbedBuilder, the "message" event became "messageCreate", and string styles and colours became enums.