Skip to content

1.0.1 / 2019-12-10

Compare
Choose a tag to compare
@chentsulin chentsulin released this 10 Dec 07:59
· 650 commits to master since this release

messenger

  • feat(messenger): add fields support to context.getUserProfile():
const user = await context.getUserProfile({
  fields: [
    'id',
    'name',
    'first_name',
    'last_name',
    'profile_pic',
    'locale',
    'timezone',
    'gender',
  ],
});
  • fix(example): fix bottender.config.js in messenger-typing example

line

  • fix(line): set shouldBatch to false after handlerDidEnd has been called. This may be the best way to handle errors in LINE:
module.exports = async function HandleError(context, props) {
  console.error(props.error);
  if (process.env.NODE_ENV === 'development') {
    await context.pushText('There are some unexpected errors happened. Please try again later, sorry for the inconvenience.');
    await context.pushText(props.error.stack);
  } else if (!context.isReplied) {
    await context.replyText('There are some unexpected errors happened. Please try again later, sorry for the inconvenience.'
  }
  if (process.env.NODE_ENV === 'production') {
    // send your error to the error tracker, for example: Sentry
  }
};

telegram

  • feat(telegram): add telegram context.editMessageMedia():
await context.editMessageMedia(66, { type: 'photo', media: 'xxx.png' });