Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return {
ActionBody: attachment.url,
ActionType: actionType,
BgColor: "#2db9b9",
Text: attachment.name || attachment.content,
};
}, attachmentsButtons),
DefaultHeight: true,
Type: "keyboard",
};
}
if (type === "Note") {
return [new Message.Text(content, keyboard), message];
} else if (type === "Image" || type === "Video") {
const url = R.path(["object", "url"], message);
const preview = R.path(["object", "preview"], message);
if (type === "Image") {
return [new Message.Picture(url, content, preview, keyboard), message];
} else {
return [new Message.Video(url, null, preview, null, keyboard), message];
}
} else if (type === "Place") {
const latitude = R.path(["object", "latitude"], message);
const longitude = R.path(["object", "longitude"], message);
return [new Message.Location(latitude, longitude, keyboard), message];
}
return [null, message];
return {
ActionBody: attachment.url,
ActionType: actionType,
BgColor: '#2db9b9',
Text: attachment.name || attachment.content,
};
},
attachmentsButtons),
DefaultHeight: true,
Type: 'keyboard',
};
}
if (dataType === 'Note') {
return [new Message.Text(content, keyboard), message];
} else if (dataType === 'Image' || dataType === 'Video') {
const url = R.path(['object', 'url'], message);
const preview = R.path(['object', 'preview'], message);
if (dataType === 'Image') {
return [new Message.Picture(url, content, preview, keyboard), message];
} else {
return [new Message.Video(url, null, preview, null, keyboard), message];
}
} else if (dataType === 'Place') {
const latitude = R.path(['object', 'latitude'], message);
const longitude = R.path(['object', 'longitude'], message);
return [new Message.Location(latitude, longitude, keyboard), message];
}
return [null, message];
}
return {
ActionBody: attachment.url,
ActionType: actionType,
BgColor: "#2db9b9",
Text: attachment.name || attachment.content,
};
}, attachmentsButtons),
DefaultHeight: true,
Type: "keyboard",
};
}
if (type === "Note") {
return [new Message.Text(content, keyboard), message];
} else if (type === "Image" || type === "Video") {
const url = R.path(["object", "url"], message);
const preview = R.path(["object", "preview"], message);
if (type === "Image") {
return [new Message.Picture(url, content, preview, keyboard), message];
} else {
return [new Message.Video(url, null, preview, null, keyboard), message];
}
} else if (type === "Place") {
const latitude = R.path(["object", "latitude"], message);
const longitude = R.path(["object", "longitude"], message);
return [new Message.Location(latitude, longitude, keyboard), message];
}
return [null, message];