in services/receive.js [257:287]
sendMessage(response, delay = 0) {
// Check if there is delay in the response
if ("delay" in response) {
delay = response["delay"];
delete response["delay"];
}
// Construct the message body
let requestBody = {
recipient: {
id: this.user.psid
},
message: response
};
// Check if there is persona id in the response
if ("persona_id" in response) {
let persona_id = response["persona_id"];
delete response["persona_id"];
requestBody = {
recipient: {
id: this.user.psid
},
message: response,
persona_id: persona_id
};
}
setTimeout(() => GraphApi.callSendApi(requestBody), delay);
}