Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bottender

Package Overview
Dependencies
Maintainers
6
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bottender - npm Package Versions

23
22

1.5.5

Diff

chentsulin
published 1.5.4 •

Changelog

Source

1.5.4 / 2021-10-11

line

  • [deprecated] add deprecated warning to the following methods:

  • context.useAccessToken

  • context.replyButtonTemplate

  • context.push

  • context.pushText

  • context.pushImage

  • context.pushVideo

  • context.pushAudio

  • context.pushLocation

  • context.pushSticker

  • context.pushImagemap

  • context.pushFlex

  • context.pushTemplate

  • context.pushButtonTemplate

  • context.pushButtonsTemplate

  • context.pushConfirmTemplate

  • context.pushCarouselTemplate

  • context.pushImageCarouselTemplate

  • context.send

  • context.sendImage

  • context.sendVideo

  • context.sendAudio

  • context.sendLocation

  • context.sendSticker

  • context.sendImagemap

  • context.sendFlex

  • context.sendTemplate

  • context.sendButtonTemplate

  • context.sendButtonsTemplate

  • context.sendConfirmTemplate

  • context.sendCarouselTemplate

  • context.sendImageCarouselTemplate

chentsulin
published 1.5.3 •

Changelog

Source

1.5.3 / 2021-10-05

  • [deps] remove prompt-confirm.
chentsulin
published 1.5.2 •

Changelog

Source

1.5.2 / 2021-09-30

  • [deps] update dependencies.
chentsulin
published 1.5.1 •

Changelog

Source

1.5.1 / 2021-09-14

  • [new] Server: support experimental custom connectors (#781):
// bottender.config.js

module.exports = {
  channels: {
    mychannel: {
      enabled: true,
      path: '/webhooks/mychannel',
      connector: new MyConnector(/* ... */),
    },
  },
};
  • [new]: export clients, factories from messaging-apis (#806):
const {
  // clients
  MessengerClient,
  LineClient,
  TelegramClient,
  SlackOAuthClient,
  ViberClient,
  TwilioClient,

  // factories
  Messenger,
  Line,
} = require('bottender');
  • [new] Bot: implement the onRequest option (#773):
// bottender.config.js

function onRequest(body, requestContext) {
  console.log({
    body,
    requestContext,
  });
}

module.exports = {
  channels: {
    messenger: {
      // ...
      onRequest,
    },
    whatsapp: {
      // ...
      onRequest,
    },
    line: {
      // ...
      onRequest,
    },
    telegram: {
      // ...
      onRequest,
    },
    slack: {
      // ...
      onRequest,
    },
    viber: {
      // ...
      onRequest,
    },
  },
};
  • [new] RequestContext: add id to RequestContext (#774)
  • [fix] Server: should await for connector.preprocess (#771)
  • [deps] upgrade messaging-apis to v1.0.0

messenger

  • [new] get/set/delete user level persistent menu for context user (#790):
await context.getUserPersistentMenu();
// [
//   {
//     locale: 'default',
//     composerInputDisabled: false,
//     callToActions: [
//       {
//         type: 'postback',
//         title: 'Restart Conversation',
//         payload: 'RESTART',
//       },
//       {
//         type: 'web_url',
//         title: 'Powered by ALOHA.AI, Yoctol',
//         url: 'https://www.yoctol.com/',
//       },
//     ],
//   },
// ]

await context.setUserPersistentMenu([
  {
    locale: 'default',
    composerInputDisabled: false,
    callToActions: [
      {
        type: 'postback',
        title: 'Restart Conversation',
        payload: 'RESTART',
      },
      {
        type: 'web_url',
        title: 'Powered by ALOHA.AI, Yoctol',
        url: 'https://www.yoctol.com/',
      },
    ],
  },
]);

await context.deleteUserPersistentMenu();

line

  • [new] support line multi-channel using getConfig (#770):
// bottender.config.js
module.exports = {
  channels: {
    line: {
      enabled: true,
      path: '/webhooks/line/:channelId',
      async getConfig({ params }) {
        console.log(params.channelId);
        // ...get the config from the API, database or wherever you like when every time receiving a new event
        return {
          accessToken,
          channelSecret,
        };
      },
    },
  },
};
  • [new] add emojis on LINE text message event (#793):
if (context.event.isMessage) {
  context.event.message.emojis;
  // [
  //   {
  //     index: 14,
  //     length: 6,
  //     productId: '5ac1bfd5040ab15980c9b435',
  //     emojiId: '001',
  //   },
  // ]
}
  • [new] add LineContext.getMembersCount method (#824):
await context.getMembersCount();
// 10

telegram

  • [new] add TelegramEvent.isPollAnswer and TelegramEvent.pollAnswer (#745):
if (context.event.isPollAnswer) {
  console.log(context.event.pollAnswer);
}
  • [new] add pollAnswer to telegram routes:
const { router, telegram } = require('bottender/router');

async function HandlePollAnswer(context) {
  // ...
}

function App() {
  return router([telegram.pollAnswer(HandlePollAnswer)]);
}
  • [new] add TelegramContext.answerCallbackQuery (#750):
await context.answerCallbackQuery({
  url: 'https://example.com/',
});

slack

  • [new] slack route accept any requests by passing * (#758):
const { router, slack } = require('bottender/router');

async function HandleAllEvent(context) {
  // ...
}

function App() {
  return router([slack.event('*', HandleAllEvent)]);
}
  • [fix] fix context.views.open in slack home tab (#809)
  • [fix] fix route slack event (#841)
  • [fix] fix slack session when channel id is null (#802)
  • [docs] update slack routes improvement (#759)
  • [example] example: slack update and delete (#769)
  • [example] slack home tab (#829)
  • [example] slack modal on home (#827)
  • [example] slack modal update (#825)
  • [example] slack modal form (#828)

dialogflow

  • [deps] use @google-cloud/dialogflow v4

create-bottender-app

  • [fix] fix context concat and env name (#859)

bottender-facebook

  • [new] add new connector - FacebookConnector to experiment using same connector for Messenger and Facebook.
// bottender.config.js
const { FacebookConnector } = require('@bottender/facebook');

module.exports = {
  channels: {
    facebook: {
      enabled: true,
      path: '/webhooks/facebook',
      connector: new FacebookConnector({
        // The top level access token should be provided for the batch requests.
        accessToken: process.env.FACEBOOK_ACCESS_TOKEN,
        appSecret: process.env.FACEBOOK_APP_SECRET,
        verifyToken: process.env.FACEBOOK_VERIFY_TOKEN,
        origin: process.env.FACEBOOK_ORIGIN,
        async mapPageToAccessToken(pageId) {
          console.log(pageId);
          return accessToken;
        },
      }),
      onRequest: onFacebookRequest,
    },
  },
};
link515
published 1.5.1-alpha.9 •

link515
published 1.5.1-alpha.8 •

chentsulin
published 1.4.10 •

Changelog

Source

1.4.10 / 2020-07-24

  • [fix] add Interaction type for route slack.event (#842)
chentsulin
published 1.5.1-alpha.7 •

chentsulin
published 1.5.1-alpha.5 •

23
22
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc