This repository holds SDK related to Bot Advertising Platform.
- node.js 20+
Install the latest version with
npm i @codd-tech/bap-sdk-node
SDK accepts single update from the Telegram bot as an object.
const bap = new BAP('<bap_token>')
bap.handleTelegramUpdates(update)
If your advertisement mode is set to manual you can mark ad placement in your code by calling:
bap.advertisement(update)
Interrupting control flow
At times, BAP may introduce telegram updates within its advertisement flow. To maintain the logical consistency of your bot, it is necessary to ignore such updates.
The BAP::handleTelegramUpdates
method returns a boolean value indicating whether you should proceed with handling the request or skip it as an internal BAP request.
When the method returns false
, it signifies that the current request should not be processed by your bot.
API key is not your Telegram bot token.
API key must be obtained from socialjet.pro
Bugs and feature request are tracked on GitHub
Bot Advertising Platform SDK is licensed under the MIT License - see the LICENSE file for details