Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bot.onEvent(async context => {
if (context.event.text === 'video') {
const attachment = getAttachment('video.mp4');
await context.sendVideo({ attachment_id: attachment.id });
} else {
const attachment = getAttachment('bottender.png');
await context.sendImage({ attachment_id: attachment.id });
}
});
bot.onEvent(async context => {
if (context.event.text === 'video') {
const attachment = getAttachment('video.mp4');
await context.sendVideo({ attachment_id: attachment.id });
} else {
const attachment = getAttachment('bottender.png');
await context.sendImage({ attachment_id: attachment.id });
}
});