简体   繁体   English

如何在Bot Framework连接器的此侦听功能中手动发送请求和响应对象?

[英]How i can manually send req and response object in this listen function of connector in Bot Framework?

I want to dynamically set a listener for a request on the basis of params passed? 我想根据传递的参数动态设置请求的侦听器?

app.post(/asd/message,connector.liten());

want to do? 想做?

app.post(/asd/message/:parameter,function(req, resp,next){
     console.log(req.params.parameter);
     resp.send(connector.listen(req,resp));
});

Use express middleware: 使用快速中间件:

server.post('/api/messages/:p', [(req,res,next)=>{
    console.log(req.params.p);
    next();
},connector.listen()]);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在beforeCreate函数中发送响应? - How can I send a response in beforeCreate function? 如何在 Microsoft bot 框架中获取 bot 发送给用户的最后一条消息? 或者是否可以通过连接器 api 更新用户状态? - How to get last message send by bot to user in Microsoft bot framework ? or is it possible to update user state via connector api? 如何从机器人内部向 Microsoft 机器人发送消息,以便消息通过对话流并获得相应的响应? - How can I send a message to the Microsoft bot from within the bot so that the message will go through the dialog flow with corresponding response? 如何让聊天机器人(机器人框架)将附件从任何文件夹发送给用户(NodeJS)? - How can i make the chatbot (bot framework) send an attached file from any folder to the user (NodeJS)? 一段时间不活动后,如何从 bot 框架 sdk 发送消息? 在节点中 - How can I send a message from bot framework sdk after a period of inactivity? In nodejs 如何将画布对象转换为图像以作为 API 响应发送? - How can I transform a canvas object into an image to send as an API response? 在Microsoft Bot Framework中,如何发送具有表格格式的味精? - In Microsoft Bot Framework, how do I send a msg with a table format? 如何从执行req.write()的Express Route发回响应? - How to I send a response back from Express Route performing a req.write()? 如何在护照的反序列化用户 function 中获取 req.params? - How can I get the req.params in the deserializeUser function of passport? Bot Framework中是否有endConversation事件要监听? - Is there an endConversation event to listen for in the Bot Framework?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM