简体   繁体   English

错误:ChatConnector:startConversation-地址无效

[英]Error : ChatConnector: startConversation - address is invalid

I'm attempting to send a proactive message upon receiving an HTTP post request.The request sends an address object and a message. 我正在尝试在收到HTTP发布请求后发送主动消息。该请求发送一个地址对象和一条消息。 I tried deleting the conversion property as mentioned . 我尝试删除提及的conversion属性。 But no luck.Any help is appreciated! 但是没有运气,我们将不胜感激!

server.use(restify.plugins.bodyParser()); 

// Do POST this endpoint to deliver a notification
server.post('/api/followUpNotification',(req, res, next) => {
  var dialogName = navigation.GetMainMenuDialog("index","FOLLOW_UP_MESSAGE");
  delete req.body.savedAddress.conversation;
  bot.beginDialog(dialogName,{savedAddress: req.body.savedAddress,message:req.body.followupMessage}); 
  res.send('triggered');
  next();
 }
);

The bot.beginDialog method is used to start a new dialog proactively, the current dialog stack will be replaced when calling this method. bot.beginDialog方法用于主动启动新对话框,调用此方法时将替换当前对话框堆栈。

The constructor of this method is like this: 此方法的构造函数是这样的:

beginDialog(address: IAddress, dialogId: string, dialogArgs?: any, done?: (err: Error) => void): void;

And you called this method like this: 您这样调用此方法:

bot.beginDialog(dialogName,{savedAddress: req.body.savedAddress,message:req.body.followupMessage});

So if your {savedAddress: req.body.savedAddress,message:req.body.followupMessage} is the address which is saved in a previous conversation, then you can call it like this: 因此,如果您的{savedAddress: req.body.savedAddress,message:req.body.followupMessage}是保存在先前对话中的地址,那么您可以这样称呼它:

bot.beginDialog({savedAddress: req.body.savedAddress,message:req.body.followupMessage}, dialogName);

If you have any other question about this, please leave a comment. 如果您对此还有其他疑问,请发表评论。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM