I'm attempting to send a proactive message upon receiving an HTTP post request.The request sends an address object and a message. I tried deleting the conversion property as mentioned . 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.
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:
bot.beginDialog({savedAddress: req.body.savedAddress,message:req.body.followupMessage}, dialogName);
If you have any other question about this, please leave a comment.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.