Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const handleEvent = event => {
const { type, replyToken, message } = event;
const messageType = message.type;
if (type !== 'message' || messageType !== 'text') {
return Promise.resolve(null);
}
if (verifyEvents.includes(replyToken)) return Promise.resolve(null);
return client.reply(replyToken, [
Line.createText('Hello'),
Line.createImage(imageUrl),
Line.createText('End'),
]);
};
pushImage(
image: {
originalContentUrl: string;
previewImageUrl?: string;
},
options?: LineTypes.MessageOptions
) {
return this.push([Line.createImage(image, options)], options);
}
replyImage(
image: {
originalContentUrl: string;
previewImageUrl?: string;
},
options?: LineTypes.MessageOptions
) {
return this.reply([Line.createImage(image, options)], options);
}
sendImage(
image: {
originalContentUrl: string;
previewImageUrl?: string;
},
options?: LineTypes.MessageOptions
) {
return this.send([Line.createImage(image, options)], options);
}