Skip to content

0.14.21 / 2018-02-05

Compare
Choose a tag to compare
@chentsulin chentsulin released this 05 Feb 15:41
· 1317 commits to master since this release
  • [new] Support all of methods on ConsoleContext with fallbackMethods: true #184, for example:
const bot = new ConsoleBot({ fallbackMethods: true });

bot.onEvent(async context => {
  await context.sendText('Hello World');
  await context.sendImage('https://example.com/vr.jpg');
  await context.sendButtonTemplate('What do you want to do next?', [
    {
      type: 'web_url',
      url: 'https://petersapparel.parseapp.com',
      title: 'Show Website',
    },
    {
      type: 'postback',
      title: 'Start Chatting',
      payload: 'USER_DEFINED_PAYLOAD',
    },
  ]);
});

Result:

Bot > Hello World
Bot > sendImage: ["https://example.com/vr.jpg"]
Bot > sendButtonTemplate: ["What do you want to do next?",[{"type":"web_url","url":"https://petersapparel.parseapp.com","title":"Show Website"},{"type":"postback","title":"Start Chatting","payload":"USER_DEFINED_PAYLOAD"}]]
  • [fix] Catch write session error in async mode #185
  • [improve] Show warning when calling setState or resetState after session have been written #186