Having trouble sending a message to a channel with Discord.js [duplicate]

Solution 1:

You need to enable the GUILD_MESSAGES intent:

const client = new Client({
  intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});

This will enable you to receive the MESSAGE_CREATE event for messages sent in guilds.

A full list of intents can be found on the Discord developer docs.

Additionally, if you are using Discord.js v13, the message event has been deprecated as it has been renamed to messageCreate.