Currently, I am attempting to set up my discord.js version 12.0.0 bot to react to specific words using arrays for words and corresponding responses. However, I am encountering the following error message:
TypeError: Cannot read property 'split' of undefined
const Discord = require("discord.js");
const client = new Discord.Client();
const message = new Discord.Message();
var messages = ['hello','goodbye','yes','no','thanks'];
var responses = ['Hello!','Goodbye!','Yes','No','You're welcome'];
var content = message.content.split(' ');
client.on("message", (message) => {
if (message.content.includes(responseObject[message.content])) {
message.channel.send(responseObject[message.content]);
}
});