Skip to content

Releases: Yoctol/bottender

1.1.2 / 2020-01-03

03 Jan 04:09
Compare
Choose a tag to compare
  • [fix] fix(DevServer): call super.prepare() in prepare method to avoid overwriting parent method

1.0.7 / 2020-01-03

03 Jan 04:01
Compare
Choose a tag to compare
  • [fix] fix(DevServer): call super.prepare() in prepare method to avoid overwriting parent method

1.1.1 / 2020-01-02

02 Jan 09:41
Compare
Choose a tag to compare
  • [fix] improve error message when there are errors in bottender.config.js (#611)

1.1.0 / 2019-12-27

27 Dec 07:33
Compare
Choose a tag to compare
  • [new] improve error messages for bots configuration:
LINE channel secret is required. Please make sure you have filled it correctly in `bottender.config.js` or `.env` file.

Instead of:

TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be one of type Buffer, TypedArray, DataView, string, or KeyObject. Received type undefined

messenger

  • [new] Added Messenger routes:
const { router, messenger } = require('bottender/router');

function Action() {
  // ...
}

function App() {
  return router([
    messenger.message(Action),
    messenger.accountLinking.linked(Action),
    messenger.accountLinking.unlinked(Action),
    messenger.accountLinking(Action),
    messenger.checkoutUpdate(Action),
    messenger.delivery(Action),
    messenger.echo(Action),
    messenger.gamePlay(Action),
    messenger.passThreadControl(Action),
    messenger.takeThreadControl(Action),
    messenger.requestThreadControl(Action),
    messenger.appRoles(Action),
    messenger.optin(Action),
    messenger.payment(Action),
    messenger.policyEnforcement(Action),
    messenger.postback(Action),
    messenger.preCheckout(Action),
    messenger.read(Action),
    messenger.referral(Action),
    messenger.standby(Action),
    messenger(Action),
  ]);
}

line

  • [new] Added LINE routes:
const { router, line } = require('bottender/router');

function Action() {
  // ...
}

function App() {
  return router([
    line.message(Action),
    line.follow(Action),
    line.unfollow(Action),
    line.join(Action),
    line.leave(Action),
    line.memberJoined(Action),
    line.memberLeft(Action),
    line.postback(Action),
    line.beacon.enter(Action),
    line.beacon.banner(Action),
    line.beacon.stay(Action),
    line.beacon(Action),
    line.accountLink(Action),
    line.things.link(Action),
    line.things.unlink(Action),
    line.things.scenarioResult(Action),
    line.things(Action),
    line(Action),
  ]);
}

slack

  • [new] Implemented native Slack chat APIs, see Slack API Doc for further information.
    e.g.
context.chat.postMessage(...);
context.chat.postEphemeral(...);
context.chat.update(...);
context.chat.delete(...);
context.chat.meMessage(...);
context.chat.getPermalink(...);
context.chat.scheduleMessage(...);
context.chat.deleteScheduledMessage(...);
context.chat.scheduledMessages.list(...);

context.postMessageandcontext.postEphemeralis now deprecated, usecontext.chat.postMessageandcontext.chat.postEphemeral instead.

  • [new] Implemented native Slack views APIs, see Slack API Doc for further information.
    e.g.
context.views.open(...);
context.views.publish(...);
context.views.push(...);
context.views.update(...);

For views, we keep channelId in privateMetadata to get session key for upcoming view events. (ref)

  • [new] Added Slack routes:
const { router, slack } = require('bottender/router');

function Action() {
  // ...
}

function App() {
  return router([
    slack.message(Action),
    slack.event('pin_added', Action),
    slack.event('star_added', Action),
    slack(Action),
  ]);
}

telegram

  • [new] Added Telegram routes:
const { router, telegram } = require('bottender/router');

function Action() {
  // ...
}

function App() {
  return router([
    telegram.message(Action),
    telegram.editedMessage(Action),
    telegram.channelPost(Action),
    telegram.editedChannelPost(Action),
    telegram.inlineQuery(Action),
    telegram.chosenInlineResult(Action),
    telegram.callbackQuery(Action),
    telegram.shippingQuery(Action),
    telegram.preCheckoutQuery(Action),
    telegram.poll(Action),
    telegram(Action),
  ]);
}

viber

  • [new] Added Viber routes:
const { router, viber } = require('bottender/router');

function Action() {
  // ...
}

function App() {
  return router([
    viber.message(Action),
    viber.subscribed(Action),
    viber.unsubscribed(Action),
    viber.conversationStarted(Action),
    viber.delivered(Action),
    viber.seen(Action),
    viber.failed(Action),
    viber(Action),
  ]);
}

1.0.6 / 2019-12-24

24 Dec 06:43
Compare
Choose a tag to compare
  • [fix] session should never expire by default #595

1.0.5 / 2019-12-19

19 Dec 15:42
Compare
Choose a tag to compare
  • [fix] move init session and bots into server prepare step #589

1.0.4 / 2019-12-17

17 Dec 10:39
Compare
Choose a tag to compare
  • [fix] session: use Windows safe key separator for file session

1.0.3 / 2019-12-12

12 Dec 09:19
Compare
Choose a tag to compare
  • [fix] server: require Bot using pascal case

1.0.2 / 2019-12-12

12 Dec 06:29
Compare
Choose a tag to compare
  • [fix] server: add prepare support for production mode.

1.0.1 / 2019-12-10

10 Dec 07:59
Compare
Choose a tag to compare

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' });