I wanted to make the bot read messages and reply if the message contains a certain string, but every time I try to console.log() the message that the function received as a parameter it was a void string. What is the problem?
This is my code:
const Discord = require("discord.js")
const client = new Discord.Client(
{ intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_MESSAGES"] }
)
client.login("")
client.on("ready", () => {
console.log("Bot ONLINE");
})
client.on("messageCreate", (message) => {
console.log(message)
if( message.content == "the condition"){
message.channel.send("the message");
}
})
This is what the VSC terminal shows when i console.log(message)