https://github.com/codd-tech/bap-sdk-python
Bot Advertising Platform SDK
https://github.com/codd-tech/bap-sdk-python
advertising cpa pypi python sdk
Last synced: 5 months ago
JSON representation
Bot Advertising Platform SDK
- Host: GitHub
- URL: https://github.com/codd-tech/bap-sdk-python
- Owner: codd-tech
- License: mit
- Created: 2022-11-11T16:48:32.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T10:16:45.000Z (about 2 years ago)
- Last Synced: 2024-05-12T11:26:57.222Z (about 2 years ago)
- Topics: advertising, cpa, pypi, python, sdk
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Bot Advertising Platform SDK
[](https://pypi.python.org/pypi/bapsdk)
[](https://pypi.python.org/pypi/bapsdk)
This repository holds SDK related to
[Bot Advertising Platform](https://publisher.socialjet.pro/).
## Requirements
- Python >=3.7
## Installation
Install the latest version with
```bash
$ pip install bapsdk
```
The BAP SDK uses the UDP protocol for data transfer to ensure minimal SDK overhead for the user.
### Usage
See [examples](./examples)
- [Basic usage](examples/basic.py)
- [Usage with aiogram](examples/aiogram_bot.py)
#### 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.handle_update` 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.
For manual advertisement mode (Should be turned on in settings) call following in the desired ad placements.
```python
bap.send_advertisement(update)
```
### API Key
**API key is not your Telegram bot token.**
API key must be obtained from [socialjet.pro](https://publisher.socialjet.pro/)
## About
### Submitting bugs and feature requests
Bugs and feature request are tracked on [GitHub](https://github.com/codd-tech/bap-sdk-python)
### License
Bot Advertising Platform SDK is licensed under the MIT License - see the [LICENSE](LICENSE) file for details