Yoctol/messenger-batch

Name: messenger-batch

Owner: YOCTOL INFO INC.

Description: Gracefully batching messenger requests.

Created: 2018-02-18 14:33:44.0

Updated: 2018-05-08 08:02:41.0

Pushed: 2018-04-28 13:09:56.0

Homepage:

Size: 76

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

messenger-batch

npm Build Status License: MIT

Gracefully batching messenger requests.

Installation
install messenger-batch
Usage
t { MessengerClient, MessengerBatch } = require('messaging-api-messenger');
t { MessengerBatchQueue } = require('messenger-batch');

t client = MessengerClient.connect({
cessToken: ACCESS_TOKEN,


t queue = new MessengerBatchQueue(client);

nc () => {
ait queue.push(
MessengerBatch.sendText('psid', 'hello!');


ait queue.push(
MessengerBatch.sendMessage('psid', {
  attachment: {
    type: 'image',
    payload: {
      url:
        'https://cdn.free.com.tw/blog/wp-content/uploads/2014/08/Placekitten480-g.jpg',
    },
  },
})


nst profile = await queue.push(MessengerBatch.getUserProfile('psid'));


nsole.log(profile);
;

Retry for error: (#613) Calls to this api have exceeded the rate limit..

t { MessengerBatchQueue, isError613 } = require('messenger-batch');

t queue = new MessengerBatchQueue(client, {
ouldRetry: isError613,
tryTimes: 2,

Options
delay

Default: 1000.

retryTimes

Default: 0.

shouldRetry

Default: () => true.

License

MIT © Yoctol


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.