0

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__: , …}
  • 1
    add your code and research – Ratan Uday Kumar Jul 02 '18 at 07: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 02 '18 at 07: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 02 '18 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 03 '18 at 05:01

0 Answers0