简体   繁体   English

Slackbot与wit.ai集成中的问题

[英]Issues in Integration of Slackbot with wit.ai

I have referred to the beepbophq tutorials. 我已经提到了beepbophq教程。 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. 他们向ed展示了如何将slackbot与wit.ai集成在一起以使其更加智能。我面临的问题在于js文件的代码。wit.hears()行给我一个错误,即``hears''方法是找不到。但是在本教程中已被使用。我已经导入了witbot和botkit库。 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. 但是问题是,它永远不会执行“ bot.reply”部分。 I hope you can figure out that part. 我希望你能弄清楚那部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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