2017-09-15 50 views
0

我是新來的機器人世界。我正嘗試使用botkit中間件將IBM Watson上的Conversation服務創建與Slack Bot集成。我只是從Git獲得了代碼(Botkit Slack Integration),並試圖用我的Watson Conversation服務來回答Slack上的查詢。但是,在收到鬆散消息後,API返回以下錯誤: 沒有太多關於如何處理這些錯誤在互聯網上。可能有人請幫助我嗎?watson-developer-cloud botkit-middleware資源未找到

`> 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 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' } }

`

回答

0

好吧!未找到資源從botkit來,因爲它無法達到會話API。我在做的錯誤是,我是提供我自己的對話服務工作區的URL而不是本應該提到的對話URL:

CONVERSATION_URL = https://gateway.watsonplatform.net/conversation/api

我剛剛糾正它,這東西像黃油一樣工作。 :) 如果其他人面臨同樣的問題,我的建議是檢查其他憑據以及。雖然看起來很直截了當,但總會發生錯誤。

快樂編碼!