Skip to content

0.6.0 / 2018-11-08

Compare
Choose a tag to compare
@chentsulin chentsulin released this 07 Nov 17:28
· 43 commits to master since this release
  • [new] add skipAppSecretProof and origin support:
const bot = new Bot({
  connector: new FacebookConnector({
    accessToken: ACCESS_TOKEN,
    appSecret: APP_SECRET,
    origin: 'https://mydummytestserver.com',
    skipAppSecretProof: true,
  }),
});
  • [new] add batch support:
const { isError613 } = require('messenger-batch');

const bot = new Bot({
  connector: new FacebookConnector({
    accessToken: ACCESS_TOKEN,
    appSecret: APP_SECRET,
    batchConfig: {
      delay: 1000,
      shouldRetry: isError613, // (#613) Calls to this api have exceeded the rate limit.
      retryTimes: 2,
    },
  }),
});

For multiple pages, top level access token should be specified for batch request:

const bot = new Bot({
  connector: new FacebookConnector({
    accessToken: ACCESS_TOKEN,
    appSecret: APP_SECRET,
    mapPageToAccessToken,
    batchConfig: {
      delay: 1000,
      shouldRetry: isError613, // (#613) Calls to this api have exceeded the rate limit.
      retryTimes: 2,
    },
  }),
});