带有Azure函数App和NodeJS的Microsoft Bot框架

我正在尝试使用Microsoft Bot Framework构build一个bot。 我打算使用一个带有Http Trigger的Azure函数作为端点。 NodeJS是我select的语言。 我看到使用restify和nodejs的botframework示例,但是没有使用azure函数。 任何人都可以指出我使用azure函数和nodejs开发botframework的例子,或者给我一个例子。

来自Chris Anderson …

https://github.com/christopheranderson/functions-bot-example

您需要将其连接到HTTP触发器,以下代码将进行集成。

var listen = bot.listen(); var response = function (context) { return { send: function (status, message) { var _msg = message ? message : (typeof status !== 'number' ? status : null) var _status = typeof status === 'number' ? status : 200 var res = { status: _status, body: _msg }; context.res = res; context.done(); } } } module.exports = function (context, req) { listen(req, response(context)) }