Releases: Yoctol/bottender
Releases · Yoctol/bottender
0.15.8 / 2018-10-18
- [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
- [new] upgrade
messaging-apis
, so now we can useDEBUG
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
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
slack
- [fix] get correct channel id from more slack event format
0.15.4 / 2018-08-22
- [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 withcontext.session.platform
0.15.3 / 2018-08-21
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
messenger
- [new] Add
context.isThreadOwner()
:
await context.isThreadOwner(); // true | false
0.15.1 / 2018-07-20
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 toMessengerEvent
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 tosendAirlineUpdateTemplate
.
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
toLineContext
(#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
isfalse
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
- [fix] Upgrade
@slack/client
version to fix pjson issue (#247)