How to get a message using replytoId field in bot builder framework?

Multi tool use
Multi tool use


How to get a message using replytoId field in bot builder framework?



I want to get unanswered questions asked by the user, so whenever a user asks such question the bot replies with a default msg and when I was looking at the emulator I found this


{
"type": "message",
"text": "Sorry. I dont seem to have this information at the moment. Perhaps I can understand what you are asking if you change the keywords in your question.",
"locale": "en-US",
"localTimestamp": "2018-07-02T12:33:58+05:30",
"from": {
"id": "default-bot",
"name": "Bot"
},
"recipient": {
"id": "default-user"
},
"inputHint": "acceptingInput",
"id": "lm3belfb22nd",
"replyToId": "cdjlegbm3cni",
"channelId": "emulator",
"timestamp": "2018-07-02T07:03:58.030Z",
"conversation": {
"id": "5e6jna8i752g"
}
}



now I want to get that unanswered question using that replyToId


bot.use({
send: function (event, next) {
console.log(event);
next();
}
})



but these are the only properties present in object event


from:Object {id: "default-bot", name: "Bot"}
inputHint:"acceptingInput"
locale:"en-US"
localTimestamp:"2018-07-02T07:03:58.024Z"
recipient:Object {id: "default-user", name: "User"}
id:"default-user"
name:"User"
__proto__:Object {constructor: , __defineGetter__: , __defineSetter__: , …}
text:"Sorry. I dont seem to have this information at the moment. Perhaps I can understand what you are asking if you change the keywords in your question."
type:"message"
__proto__:Object {constructor: , __defineGetter__: , __defineSetter__: , …}





add your code and research
– Ratan Uday Kumar
Jul 2 at 7:07





apparently theres no such thing as replyToId in the nodejs sdk documentation for IEvents, so when i tried to access this property I get undefined
– Panikd Kernel
Jul 2 at 7:08





I don't understand what you're trying to do, 1) a user asks a question, 2) the bot responds to this question with a default message, 3) you want to get the replyToId on the bot's response Activity, so that you can then retrieve the original unanswered question? Instead of using middleware, why don't you add some code to your logic where you send the default message to keep track of the unanswered questions?
– Steven G.
Jul 2 at 23:18





that default message is coming from the dynamically generated dialog array from the qnamaker var basicQnAMakerDialog = new builder_cognitiveservices.QnAMakerDialog({ recognizers: [recognizer], defaultMessage: 'Sorry. I dont seem to have this information at the moment. Perhaps I can understand what you are asking if you change the keywords in your question.', qnaThreshold: 0.3 } );
– Panikd Kernel
Jul 3 at 5:01



var basicQnAMakerDialog = new builder_cognitiveservices.QnAMakerDialog({ recognizers: [recognizer], defaultMessage: 'Sorry. I dont seem to have this information at the moment. Perhaps I can understand what you are asking if you change the keywords in your question.', qnaThreshold: 0.3 } );









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

c32tVNhZVfLbh,BsEIeCO7QEGjOX 1eVpilX,iAfYdk2t XTeezCUaIbInEsg2o
s2B 3Dfq8oOa5KFrwi0SuvKsUfKgVh0tkx0 f4x3B

Popular posts from this blog

Rothschild family

Boo (programming language)