- [fix] fix getting wrong page id when receiving batch request #69
- [deps] move bottender and messaging-api-messenger to peerDependencies.
- [new] Add
skipProfile
option toFacebookConnector
to skip auto updating user profile:
const connector = new FacebookConnector({
accessToken: ACCESS_TOKEN,
appSecret: APP_SECRET,
skipProfile: true,
});
- [deps] update
messaging-api-messenger
- [new] add
skipAppSecretProof
andorigin
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,
},
}),
});
- [fix] fix FacebookConnector class property initialization.
- [breaking] Upgrade default graph api version to
3.2
- [new] rewrite
FacebookClient
to accept customorigin
url (#54):
const { Bot } = require('bottender');
const { FacebookConnector, FacebookClient } = require('bottender-facebook');
const bot = new Bot({
connector: new FacebookConnector({
appSecret: APP_SECRET,
client: FacebookClient.connect({
accessToken: ACCESS_TOKEN,
version: '3.2',
origin: 'https://mydummytestserver.com',
}),
}),
});
- [new]
client.sendComment(objectId, comment)
- support attachment as comment:
await client.sendComment('<object_id>', 'ok!'); // send as text message
await client.sendComment('<object_id>', { message: 'ok!' });
await client.sendComment('<object_id>', { attachment_id: '<attachment_id>' });
await client.sendComment('<object_id>', {
attachment_share_url: 'https://example.com/img.gif',
});
await client.sendComment('<object_id>', {
attachment_url: 'https://example.com/img.jpg',
});
- [new]
context.sendComment(comment)
- support attachment as comment:
await context.sendComment('ok!'); // send as text message
await context.sendComment({ message: 'ok!' });
await context.sendComment({ attachment_id: '<attachment_id>' });
await context.sendComment({
attachment_share_url: 'https://example.com/img.gif',
});
await context.sendComment({ attachment_url: 'https://example.com/img.jpg' });
- [new] add fields support to
getComment
#47 - [new] implement
client.sendLike
,context.sendLike
#46
client.sendLike();
context.sendLike();
- [fix] context.canReplyPrivately
- [fix] send comment to correct layer of comments
- [new] add new getter and api methods:
event.isFirstLayerComment;
client.getComment(commentId);
client.getLikes(objectId);
context.getComment();
context.getLikes();
await context.canReplyPrivately;
- [new] Bump deps
bottender: ^0.15.6
messaging-api-messenger: ^0.7.6
- [new] Bump deps
bottender: ^0.15.0-beta.10
messaging-api-messenger: ^0.7.1
- [changed] Add verify token to connector (#38)
- [changed] Use event
pageId
getter and remove_getRawEventsFromRequest
(#30)
- [new] Throw error when not get postId (#26)
- [new] Bump deps
bottender: ^0.14.16
messaging-api-messenger: ^0.6.9
- [changed] Remove breaking flowconfig change (#27)
- [new] Rename package to
bottender-facebook
- [fix] Use get page fields=access_token to retrieve access_token (#20)
- [new] Add
event.isSentByPage
- [fix] Prevent from calling
sendPrivateReply
,sendComment
to page itself
- [new] Export
FacebookClient
,FacebookContext
,FacebookEvent
- [new] Add multiple pages support via
mapPageToAccessToken
- [fix] Fixed some bugs to support Bottender 0.14