我创建了一个基于本地主机的Hubot
,并使用Botframework作为适配器。我创建了一个MS Bot帐户。我还使用MS Teams中的应用程序工作室创建了一个新应用程序。然后,我侧装它。我开始ngrok
,然后开始一切。我可以看到该机器人在Teams中处于在线状态。但是,当我向bot发送命令时,它接受了消息,但没有响应。在日志中,它似乎正在响应,但在Teams频道或@mention中看不到响应。请查看下面的日志
[Mon Jun 24 2019 17:39:51 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:39:51 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: TextMiddleware toReceivable
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: onBotEvents
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toReceivable
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: send
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: reply
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:39:57 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toSendable
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: onBotEvents
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toReceivable
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: send
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: reply
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toSendable
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: send
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: reply
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
[Mon Jun 24 2019 17:40:36 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toSendable
应用清单:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "xxxxxxxx",
"packageName": "com.tech.bot",
"developer": {
"name": "user",
"websiteUrl": "https://mm.com",
"privacyUrl": "https://mm.com/privacy",
"termsOfUseUrl": "https://mm.com/terms"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "techbot",
"full": ""
},
"description": {
"short": "bot for techbot",
"full": "bot for techbot"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "xxxxxxxxd",
"scopes": [
"personal",
"team",
"groupchat"
],
"commandLists": [
{
"scopes": [
"personal"
],
"commands": [
{
"title": "hi",
"description": "How are u!!!"
}
]
},
{
"scopes": [
"team"
],
"commands": [
{
"title": "hi",
"description": "Greet!!!"
},
{
"title": "hi",
"description": "How are u!!!"
}
]
},
{
"scopes": [
"groupchat"
],
"commands": [
{
"title": "hi",
"description": "Greet!!!"
},
{
"title": "hi",
"description": "How are u!!!"
}
]
}
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": []
}
调试日志如下所示
express:router dispatching POST /api/messages +44s
express:router query : /api/messages +0ms
express:router expressInit : /api/messages +0ms
express:router <anonymous> : /api/messages +1ms
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" +1ms
body-parser:json read body +0ms
body-parser:json parse body +0ms
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
[Wed Jun 26 2019 08:33:32 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: onBotEvents
[Wed Jun 26 2019 08:33:32 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message
[Wed Jun 26 2019 08:33:32 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...
finalhandler cannot 404 after headers sent +6ms