I'm trying to write a bot using discord.js. Everything was working until I updated to the latest version (14.6.0) from 12.5.3 and now my bot can't seem to receive messages. I'm thinking it has something to do with the intents that Discord has implemented but I'm not exactly sure.
I'm not sure if this is relevant but I'm running nodejs version 18.11.0
Here's the relevant part of my code
const { Discord, EmbedBuilder, Client, GatewayIntentBits, Intents, IntentsBitField } = require('discord.js');
const client = new Client({ intents: [IntentsBitField.Flags.Guilds,IntentsBitField.Flags.GuildMessages] });
client.login('TOKEN');
client.on('message', msg => {
console.log("RECIEVED MESSAGE")
...
I can get the bot to log in, but the message never logs to the console.
Thanks in advance!