.hears() function weird problem with a generated array (facebook-related)
Hi, I am using an api controller to get keywords from an certain API and trying to place the result array in the ".hears" function. For some reason it doesn't work. "keywords" is getting the right array for sure (checked that). Does someone has any idea? Thanks in advance.
api.getKeywords(function(keywords) {
controller.hears(keywords,'message_received', function (bot, message) {
...
}
});
Hi, I have made a separate file for keywords.
module.exports = { name: [ 'identify yourself', 'who are you', 'name', 'bot' ], greet: [ 'hi', 'hello', 'hey', 'yo' ] }
This is my bot.js where I have my controller.
controller.hears(keyword.name, 'message_received', function(bot, message) { bot.reply(message, ':|] I am a bot for Zyloon.'); })
Tell me if this helps you
Did this help? Closing for now, feel free to reopen!