0

我想得到用户提出的未回答的问题,所以每当用户提出这样的问题时,机器人都会用默认的 msg 回复,当我查看模拟器时,我发现了这个

 {
  "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"
  }
}

现在我想用那个replyToId得到那个未回答的问题

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

但这些是对象事件中存在的唯一属性

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__: , …}
4

0 回答 0