catching "undefined" hears() patterns of users
By that I mean that I am looking for a quick way to respond to user's input which is not defined in my hears() functions. For example, let's say I got:
controller.hears("jacket").. controller.hears("shoes").. ... a lot of other hears("...").... ....
I want that in case a user inputs anything besides of (jacket, shoes.... all the others), to get a reply from the bot, let's say: boy.reply("Sorry I can't understand. Please try again with a different input").
I thought about storing of my inputs and then validating on a global message_received event, but it's too messy and there will be problems with the regex patterns.
Did this solve your question? If not, please reopen!
You can do it checking if message is a text:
controller.on('message_received', function(bot, message) {
if(message.seq){
bot.reply(message, 'txt')
}
});