i want try make robot upload file,i did what the doc write ,i first send a upload QA card
card json :{ "attachments": [{ "contentType": "application/vnd.microsoft.teams.card.file.consent", "name": "file_example.txt", "content": { "description": "<Purpose of the file, such as: this is your monthly expense report>", "sizeInBytes": 1029393, "acceptContext": { }, "declineContext": { } } }] }
and it work ,robot send the card to us chat,then if i click accept or don't accpet ,then in robot service i saw some error log :
**
[Thu Oct 17 2019 09:30:31 GMT+0800 (GMT+08:00)] DEBUG No listeners executed; falling back to catch-all
express:router dispatching POST /api/messages +7s
express:router query : /api/messages +0ms
express:router expressInit : /api/messages +0ms
express:router : /api/messages +0ms
express:router query : /api/messages +0ms
express:router jsonParser : /api/messages +0ms
body-parser:json content-type "application/json; charset=utf-8" +0ms
body-parser:json content-encoding "identity" +0ms
body-parser:json read body +0ms
body-parser:json parse body +1ms
body-parser:json parse json +0ms
express:router urlencodedParser : /api/messages +0ms
body-parser:urlencoded body already parsed +0ms
express:router multipart : /api/messages +0ms
ChatConnector: message received.
TypeError: this.onInvokeHandler is not a function
at ChatConnector.onDispatchEvents (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:545:22)
at ChatConnector.dispatch (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:557:18)
at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:150:27
at OpenIdMetadata.getKey (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/OpenIdMetadata.js:26:13)
at ChatConnector.verifyBotFramework (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:124:28)
at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:46:23
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at next (/home/chatbot/hubot/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/chatbot/hubot/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at multipart (/home/chatbot/hubot/node_modules/connect-multiparty/index.js:49:27)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at urlencodedParser (/home/chatbot/hubot/node_modules/body-parser/lib/types/urlencoded.js:82:7)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at /home/chatbot/hubot/node_modules/body-parser/lib/read.js:130:5
at invokeCallback (/home/chatbot/hubot/node_modules/raw-body/index.js:224:16)
at done (/home/chatbot/hubot/node_modules/raw-body/index.js:213:7)
at IncomingMessage.onEnd (/home/chatbot/hubot/node_modules/raw-body/index.js:273:7)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
**
but i still can get the action ,i mean appet upload file or don't accpet actions ,so i want know what problem with the error and how to fix it ? ,the error give me feel like the botbuilder don't have correspond code for upload file actions.
i read this doc: https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-files
i want try make robot upload file,i did what the doc write ,i first send a upload QA card card json :
{ "attachments": [{ "contentType": "application/vnd.microsoft.teams.card.file.consent", "name": "file_example.txt", "content": { "description": "<Purpose of the file, such as: this is your monthly expense report>", "sizeInBytes": 1029393, "acceptContext": { }, "declineContext": { } } }] }
and it work ,robot send the card to us chat,then if i click accept or don't accpet ,then in robot service i saw some error log : ** [Thu Oct 17 2019 09:30:31 GMT+0800 (GMT+08:00)] DEBUG No listeners executed; falling back to catch-all express:router dispatching POST /api/messages +7s express:router query : /api/messages +0ms express:router expressInit : /api/messages +0ms express:router : /api/messages +0ms
express:router query : /api/messages +0ms
express:router jsonParser : /api/messages +0ms
body-parser:json content-type "application/json; charset=utf-8" +0ms
body-parser:json content-encoding "identity" +0ms
body-parser:json read body +0ms
body-parser:json parse body +1ms
body-parser:json parse json +0ms
express:router urlencodedParser : /api/messages +0ms
body-parser:urlencoded body already parsed +0ms
express:router multipart : /api/messages +0ms
ChatConnector: message received. TypeError: this.onInvokeHandler is not a function at ChatConnector.onDispatchEvents (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:545:22) at ChatConnector.dispatch (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:557:18) at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:150:27 at OpenIdMetadata.getKey (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/OpenIdMetadata.js:26:13) at ChatConnector.verifyBotFramework (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:124:28) at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:46:23 at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5) at next (/home/chatbot/hubot/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/chatbot/hubot/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5) at /home/chatbot/hubot/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12) at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10) at multipart (/home/chatbot/hubot/node_modules/connect-multiparty/index.js:49:27) at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13) at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12) at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10) at urlencodedParser (/home/chatbot/hubot/node_modules/body-parser/lib/types/urlencoded.js:82:7) at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13) at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12) at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10) at /home/chatbot/hubot/node_modules/body-parser/lib/read.js:130:5 at invokeCallback (/home/chatbot/hubot/node_modules/raw-body/index.js:224:16) at done (/home/chatbot/hubot/node_modules/raw-body/index.js:213:7) at IncomingMessage.onEnd (/home/chatbot/hubot/node_modules/raw-body/index.js:273:7) at IncomingMessage.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) ** but i still can get the action ,i mean appet upload file or don't accpet actions ,so i want know what problem with the error and how to fix it ? ,the error give me feel like the botbuilder don't have correspond code for upload file actions.