I'm currently making a chatbot for a school project. Its goal is to solve problems around school. But there are some issues in my code. I keep getting the following message:
(parameter) index: any
'index' is declared but its value is never read.ts(6133)
And...
TypeError: digibord is not a function
at digibord.forEach (C:\Users\marti\Chatbot\index.js:47:13)
My code looks like the following:
var digibord =
{
name: ["digibord","smartboard","schoolbord"]
};
function handleMessage(message) {
digibord.forEach((value, index) => {
if (value.name.includes(message)) {
digibord();
console.log(message);
}
});
}
function digibord() {
const params = {
icon_emoji: ':smiley:'
}
bot.postMessageToChannel('general', 'Okay...In what classroom is your current problem?',params);
};
Any tips on how to solve this?