我是机器人世界的新手。我正在尝试使用botkit中间件将在IBM上创建的会话服务与Slack集成起来。我只是从Git (僵尸工具包集成 )获得了代码,并试图使用Git来回答我的沃森会话服务中的Slack查询。但是,在接收到松弛消息后,API将返回以下错误。关于如何在Internet上处理这些错误,并没有太多的文档。有人能帮帮我吗?
> node simple-bot-slack.js info: \*\* No persistent storage method specified! Data may be lost when process shuts down. info: \*\* Setting up custom handlers for processing Slack messages info: \*\* API CALL: [https://slack.com/api/rtm.start](https://slack.com/api/rtm.start) Client server listening on port 5000 notice: \*\* BOT ID: jarvis ...attempting to connect to RTM! notice: RTM websocket opened info: Slack message received { type: 'message', channel: 'C72GK14JD', user: 'U72VDTC2F', text: 'Hi', ts: '1505453454.000117', source\_team: 'T733VG8DS', team: 'T733VG8DS', event: 'direct\_mention', match: [ 'Hi', index: 0, input: 'Hi' ], watsonError: { Error: Resource not found at Request.\_callback (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\watson-developer-cloud\lib\requestwrapper.js:88:1 5) at Request.self.callback (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip. (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:1091:12) at Gunzip.g (events.js:292:16) at emitNone (events.js:91:20) at Gunzip.emit (events.js:185:7) at endReadableNT (\_stream\_readable.js:974:12) at \_combinedTickCallback (internal/process/next\_tick.js:80:11) at process.\_tickCallback (internal/process/next\_tick.js:104:9) cause: { Error: Resource not found at Request.\_callback (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\watson-developer-cloud\lib\requestwrapper.js:8 8:15) at Request.self.callback (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Gunzip. (D:\node\wrath\botkit-middleware-master\examples\simple-bot\node\_modules\request\request.js:1091:12) at Gunzip.g (events.js:292:16) at emitNone (events.js:91:20) at Gunzip.emit (events.js:185:7) at endReadableNT (\_stream\_readable.js:974:12) at \_combinedTickCallback (internal/process/next\_tick.js:80:11) at process.\_tickCallback (internal/process/next\_tick.js:104:9) code: undefined, error: 'Resource not found' }, isOperational: true, code: undefined, error: 'Resource not found' } }
发布于 2017-09-15 05:55:49
好了!未找到的资源来自botkit,因为它无法到达会话API。我所犯的错误是我提供了我自己的会话服务工作区的URL,而不是应该被提到的会话URL
CONVERSATION_URL=https://gateway.watsonplatform.net/conversation/api
我刚刚纠正了它,它就像黄油一样工作。*如果其他人也面临同样的问题,我的建议是也检查其他证书。虽然看起来很简单,但错误总是会发生的。
编码愉快!
https://stackoverflow.com/questions/46232288
复制相似问题