【问题标题】:How do I integrate wit.ai and hubot?如何集成 wit.ai 和 hubot?
【发布时间】:2018-08-09 01:12:24
【问题描述】:

我想将 wit.ai 与 hubot 集成。除此之外,我还通过适配器在话语论坛服务器上运行了 hubot。那是次要的。

我安装了https://github.com/guillaumewuip/hubot-wit-helper,安装了npm包,但是运行bin/hubot时出现这个错误

[wit] Stories and POST /converse have been deprecated. This will break in February 2018!
[Thu Mar 01 2018 01:44:58 GMT+0000 (UTC)] ERROR Unable to load /var/discourse/avebot/scripts/avebot: Error: The 'send' action is missing. Learn more at https://wit.ai/docs/quickstart
  at validateActions (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:223:11)
  at validate (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:212:20)
  at new Wit (/var/discourse/avebot/node_modules/node-wit/lib/wit.js:20:35)
  at new Robot (/var/discourse/avebot/node_modules/hubot-wit-helper/lib/Robot.js:24:24)
  at bot (/var/discourse/avebot/scripts/avebot.js:28:26)
  at Robot.loadFile (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:358:11, <js>:226:13)
  at Robot.load (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:377:9, <js>:247:30)
  at Discourse.loadScripts (/var/discourse/avebot/node_modules/hubot/bin/hubot:93:5, <js>:97:13)
  at Object.onceWrapper (events.js:219:13)
  at Discourse.emit (events.js:127:13)
  at Discourse.run (/var/discourse/avebot/node_modules/hubot-discourse-adapter/src/discourse.coffee:63:5, <js>:89:12)
  at Robot.run (/var/discourse/avebot/node_modules/hubot/src/robot.coffee:590:5, <js>:464:27)
  at Object.<anonymous> (/var/discourse/avebot/node_modules/hubot/bin/hubot:168:8, <js>:182:11)
  at Object.<anonymous> (/var/discourse/avebot/node_modules/hubot/bin/hubot:5:1, <js>:185:4)
  at Module._compile (module.js:662:30)
  at Object.exports.run (/var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/coffee-script.js:103:25)
  at compileScript (/var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/command.js:171:29)
  at /var/discourse/avebot/node_modules/coffee-script/lib/coffee-script/command.js:143:18
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:532:3)

我将服务器令牌放在上面 github 页面上的示例脚本的 wit_token = 'mywittoken' 部分,它的开头是这样的

'use strict';

(() => {

    const witHelper = require('hubot-wit-helper');

    const WIT_TOKEN = 'myWitToken';

如何让这一切正常工作?是不是太旧了无法使用?

【问题讨论】:

    标签: wit.ai hubot discourse


    【解决方案1】:

    截至太平洋标准时间 2018 年 2 月 13 日上午 10 点,Wit.ai 停止了 Stories 和 /converse

    hubot-wit-helper npm 包似乎仍在使用通过 wit.runActions() [hubot-wit-helper/lib/Robot.js 第 72 行] 的故事,随着 Wit 故事的终止,它将不再有效。

    要让 wit.ai 在此包中再次运行,您需要关注 the official guide,了解如何将代码库从故事迁移到 /message API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-05
      • 1970-01-01
      • 1970-01-01
      • 2016-12-02
      相关资源
      最近更新 更多