Skip to content

Releases: Yoctol/bottender

0.15.8 / 2018-10-18

18 Oct 06:50
Compare
Choose a tag to compare
  • [new] Add sessionStore.all() to fetch all of sessions from the store:
// for those session stores
const sessionStore = new MemorySessionStore(500);
const sessionStore = new MongoSessionStore('mongodb://localhost:27017/');
const sessionStore = new FileSessionStore();
const sessionStore = new RedisSessionStore();
const sessions = await sessionStore.all();
  • [deps] update messaging-apis (which support messenger persona api)

0.15.7 / 2018-09-19

19 Sep 06:36
Compare
Choose a tag to compare
  • [new] upgrade messaging-apis, so now we can use DEBUG env variable to enable request debugger:
DEBUG=messaging-api*
  • [fix] fix ConsoleBot recognize symbol as _methodMissing (#333)
  • [deps] upgrade dependencies

0.15.6 / 2018-08-28

28 Aug 11:25
Compare
Choose a tag to compare

line

  • [new] make sure all of methods support quick reply (#331):
context.sendText('hahaha', {
  quickReply: {
    items: [
      {
        type: 'action',
        action: {
          type: 'cameraRoll',
          label: 'Send photo',
        },
      },
      {
        type: 'action',
        action: {
          type: 'camera',
          label: 'Open camera',
        },
      },
    ],
  },
});

telegram

  • [new] add isReplyToMessage, replyToMessage (#330):
event.isReplyToMessage;
event.replyToMessage;

0.15.5 / 2018-08-27

27 Aug 09:25
Compare
Choose a tag to compare

slack

  • [fix] get correct channel id from more slack event format

0.15.4 / 2018-08-22

22 Aug 06:16
Compare
Choose a tag to compare
  • [new] add debugger for sync response
DEBUG=bottender:response

print:

bottender:response Outgoing response:
bottender:response {
bottender:response   body: {
bottender:response   }
bottender:response }

Useful when debugging synchronized connectors.

console

  • [fix] makes context.platform consistent with context.session.platform

0.15.3 / 2018-08-21

21 Aug 08:19
Compare
Choose a tag to compare

console

  • [new] Add mockPlatform option:
const bot = new ConsoleBot({
  fallbackMethods: true,
  mockPlatform: 'messenger',
});

bot.connector.platform; // 'messenger'
bot.onEvent(context => {
  context.platform; // 'messenger'
});

0.15.2 / 2018-08-16

16 Aug 03:10
Compare
Choose a tag to compare

messenger

  • [new] Add context.isThreadOwner():
await context.isThreadOwner(); // true | false

0.15.1 / 2018-07-20

20 Jul 07:40
Compare
Choose a tag to compare
  • [fix] fix cli hint (#311)
  • [fix] not print empty array other args in ConsoleBot fallbackMethods (#314)

0.15.0 / 2018-07-18

18 Jul 04:37
Compare
Choose a tag to compare

v0.15 is the second major version after we open sourced Bottender. In this version, we introduce a lot of helpful, community requested features based on Messaging APIs v0.7.

  • [new] add context.requestContext:

Express, Micro, Restify:

context.requestContext; // { req, res }

Koa:

context.requestContext; // ctx in koa
  • [new] add more debug logs and key change (#239, #295), so you can run bots with following DEBUG env:
DEBUG=bottender:*
DEBUG=bottender:request
DEBUG=bottender:session:read
DEBUG=bottender:session:write
  • [new] skip and show warning when calling send API in Messenger echo delivery read event (#306)
  • [fix] deepClone when read from MemoryCacheStore (#235)
  • [deps] Upgrade to Babel 7

messenger

  • [breaking] remove deprecated MessengerContext method - sendQuickReplies
  • [new] support Messenger platform v2.4.
  • [new] enable verifying graph API calls with appsecret_proof by default.
  • [new] context.getThreadOwner
const threadOwner = await context.getThreadOwner();
// {
//   app_id: '12345678910'
// }
  • [new] add pageId, gamePlay, brandedCamera, isRequestThreadControlFromPageInbox getters to MessengerEvent
context.event.pageId; // "<PAGE_ID>"

context.event.isRequestThreadControlFromPageInbox; // true

context.event.isGamePlay; //
context.event.gamePlay; //

context.event.isBrandedCamera; //
context.event.brandedCamera; //
  • [new] implement Batch Mode to send multiple requests in one batch (up to 50 messages):
const { isError613 } = require('messenger-batch');

new MessengerBot({
  // ...
  batchConfig: {
    delay: 1000,
    shouldRetry: isError613, // (#613) Calls to this api have exceeded the rate limit.
    retryTimes: 2,
  },
});

It will enable message batching functionality via messaging-api-messenger under the hood.

  • [deprecated] sendAirlineFlightUpdateTemplate has been renamed to sendAirlineUpdateTemplate.

line

  • [new] support LINE Flex Message with replyFlex, pushFlex, sendFlex:
context.sendFlex('this is a flex', {
  type: 'bubble',
  header: {
    type: 'box',
    layout: 'vertical',
    contents: [
      {
        type: 'text',
        text: 'Header text',
      },
    ],
  },
  hero: {
    type: 'image',
    url: 'https://example.com/flex/images/image.jpg',
  },
  body: {
    type: 'box',
    layout: 'vertical',
    contents: [
      {
        type: 'text',
        text: 'Body text',
      },
    ],
  },
  footer: {
    type: 'box',
    layout: 'vertical',
    contents: [
      {
        type: 'text',
        text: 'Footer text',
      },
    ],
  },
  styles: {
    comment: 'See the example of a bubble style object',
  },
});
  • [new] add issueLinkToken to LineContext (#245):
const result = await context.issueLinkToken();
// {
//   linkToken: 'NMZTNuVrPTqlr2IF8Bnymkb7rXfYv5EY',
// }
  • [new] add LINE linkAccount events support (#243):
context.event.isAccountLink; // true
context.event.linkAccount;
// {
//   result: 'ok',
//   nonce: 'xxxxxxxxxxxxxxx',
// }
  • [new] add shouldBatch option:
new LineBot({
  // ...
  shouldBatch: true, // Default: false
});

When batching is enabled,

context.replyText('Hi');
context.replyText('Hi');
context.replyText('Hi');
context.replyText('Hi');
context.replyText('Hi');

Those 5 messages will be sent in one API call, just like the below one.

const { Line } = require('messaging-api-line');

context.reply([
  Line.createText('Hi'),
  Line.createText('Hi'),
  Line.createText('Hi'),
  Line.createText('Hi'),
  Line.createText('Hi'),
]);
  • [new] add sendMethod option:
new LineBot({
  // ...
  sendMethod: 'reply', // Default: 'push'
});

telegram

  • [breaking] Now context methods throw error when ok is false in Telegram:
{
  ok: false,
  result: { /* ... */ }
}

custom connector

  • [new] pass merged query and body to handler:
{
  ...query,
  ...body,
}

It's useful in custom connectors.

  • [new] export Context from entry (#250)
const { Context } = require('bottender');

class MyContext extends Context {
  //...
}

0.14.34 / 2018-04-23

16 May 15:30
804b171
Compare
Choose a tag to compare
  • [fix] Upgrade @slack/client version to fix pjson issue (#247)