How to use the bottender/utils.getAttachment function in bottender

To help you get started, we’ve selected a few bottender examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Yoctol / bottender / examples / messenger-attachment-upload / index.js View on Github external
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 });
  }
});
github Yoctol / bottender / examples / messenger-attachment-upload / index.js View on Github external
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 });
  }
});