Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bottender

Package Overview
Dependencies
Maintainers
6
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bottender - npm Package Versions

1
22

0.15.1

Diff

Changelog

Source

0.15.1 / 2018-07-20

  • [fix] fix cli hint (#311)
  • [fix] not print empty array other args in ConsoleBot fallbackMethods (#314)
chentsulin
published 0.15.0 •

Changelog

Source

0.15.0 / 2018-07-18

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 {
  //...
}
chentsulin
published 0.15.0-rc.4 •

chentsulin
published 0.15.0-rc.3 •

chentsulin
published 0.15.0-rc.2 •

chentsulin
published 0.15.0-rc.1 •

chentsulin
published 0.15.0-beta.13 •

chentsulin
published 0.15.0-beta.12 •

chentsulin
published 0.15.0-beta.11 •

chentsulin
published 0.15.0-beta.10 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc