简体   繁体   中英

Issues in Integration of Slackbot with wit.ai

I have referred to the beepbophq tutorials. In that they show ed how to integrate slackbot with wit.ai to make it more intellegent.The problem I am facing lies in the code of js file.The line wit.hears() is giving me an error that 'hears' method is not found.But in the tutorial its being used.I have already imported witbot and botkit libraries. Kindly provide me solutions Thanks un advance

I had the same problem. I have resolved it like follows:

this.controller.hears('', ['direct_message', 'direct_mention'], function (bot, message) {
                var wit = witbot.process(message.text, bot, message);
                wit.hears('hello', 0.5, function (bot, message, outcome) {
                    console.log('MESSAGE: ' + message);
                    console.log('OUTCOME: ' + outcome);
                    bot.reply(message, 'Hello to you as well!')
                });
            });

But the problem is, it never executes the "bot.reply" part. I hope you can figure out that part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM