A powerful, automated payment gateway bot for Telegram.
Project description
🚀 Autopaybot (AvtoPaymentBot)
A Telegram-based automated payment detection system designed specifically for the Uzbekistan market.
This application uses Telegram Userbots via the Telethon library to intercept incoming transaction notifications from popular payment systems (Click, Payme, Uzcard, Humo) on behalf of merchants. It acts as an integration middleware: parsing transaction SMS/Messages in real-time and automatically firing Webhooks to your backend server.
✨ Features
- 🏢 Multi-Merchant Support: Manages concurrent Telegram Userbots for multiple independent merchants dynamically.
- 🧠 Smart Payment Parser: Uses advanced regex to instantly interpret and normalize transaction amounts from Click, Payme, Uzcard, Humo, and CardXabar notification bots.
- ⚡ Collision Management (Uzbekistan UX): Temporarily augments subsequent identical transaction requests by exactly +1 UZS (100 tiyins) to maintain uniqueness for idempotent processing without using decimals, bypassing the fractional input limitations of popular Uzbek banking apps.
- 🔗 Secure Webhook Integration: Instantly fires asynchronous HTTP webhooks signed with an HMAC (SHA-256) signature for verified backend processing.
- 🛡️ Background Health Checking: An asynchronous daemon runs every 5 minutes to verify if merchant sessions are active and automatically restarts broken connections.
🚀 Installation & Quick Start
You can run autopaybot anywhere by simply installing it via pip.
1. Install via pip
pip install autopaybot
(Note: Python 3.11+ is required)
2. Initialization Wizard
Initialize the project to create your .env configuration file interactively:
autopay init
This setup wizard will prompt you for your ADMIN_ID and can automatically generate a cryptographically secure 64-character API_KEY for you.
3. Database Migrations
Run the embedded Alembic migrations to set up your PostgreSQL (or SQLite) database:
autopay upgrade
4. Run the System
Run the unified start command to boot both the FastAPI Web Server and the Telegram Background Worker simultaneously:
autopay start
(Press Ctrl+C to safely shut down both processes).
🐳 Docker Deployment (Recommended)
Don't want to install Python packages directly? Want to deploy to a Linux VPS safely? Use our interactive Docker scaffolding tool!
- Generate a production-ready
docker-compose.ymlpointing to our official GitHub Container Registry image:autopay deploy - Bring up the containers in the background:
docker-compose up -d
(Image: ghcr.io/themirmakhmudov/autopaybot:latest)
🛠️ Testing & Development
To contribute or run automated tests locally:
# Clone the repository
git clone https://github.com/theMirmakhmudov/AutoPay-API.git
cd AutoPay-API/backend
# Install with development and testing dependencies
pip install -e .[dev]
# Run tests with coverage
pytest tests/ -v
📝 License & Disclaimer
MIT License. See the LICENSE file for details.
⚠️ Disclaimer: Using userbots to scrape messages technically falls into a grey area under Telegram's Terms of Service. Be mindful of usage rate-limits and restrict the listener solely to the official banking bots to avoid account restrictions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autopaybot-0.1.17.tar.gz.
File metadata
- Download URL: autopaybot-0.1.17.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83bafeca9b66240dc87f7cf97252a43e6de37042f34bfa210b25181a19f1217d
|
|
| MD5 |
56c1ded701cb152fee6484457f05d63f
|
|
| BLAKE2b-256 |
10a98b15186bbbabeaa1f86617850825733946fd7901cc68fdd75874cfad0ea2
|
Provenance
The following attestation bundles were made for autopaybot-0.1.17.tar.gz:
Publisher:
publish.yml on theMirmakhmudov/AutoPay-API
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autopaybot-0.1.17.tar.gz -
Subject digest:
83bafeca9b66240dc87f7cf97252a43e6de37042f34bfa210b25181a19f1217d - Sigstore transparency entry: 2164450383
- Sigstore integration time:
-
Permalink:
theMirmakhmudov/AutoPay-API@377d141f15efe3b89ac9f48993ab0a574b998695 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/theMirmakhmudov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@377d141f15efe3b89ac9f48993ab0a574b998695 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file autopaybot-0.1.17-py3-none-any.whl.
File metadata
- Download URL: autopaybot-0.1.17-py3-none-any.whl
- Upload date:
- Size: 44.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee00927cb34c5c4fff24a5c983e03bfaf4cb04f7cc0aeafa9c7d1281169c333
|
|
| MD5 |
ec99c0161ca5dbe07379c9a0e5a6aaed
|
|
| BLAKE2b-256 |
75b3028294697ff8d6a9e70e6976761c132ba897025660084e194c73f0c8391d
|
Provenance
The following attestation bundles were made for autopaybot-0.1.17-py3-none-any.whl:
Publisher:
publish.yml on theMirmakhmudov/AutoPay-API
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autopaybot-0.1.17-py3-none-any.whl -
Subject digest:
6ee00927cb34c5c4fff24a5c983e03bfaf4cb04f7cc0aeafa9c7d1281169c333 - Sigstore transparency entry: 2164450393
- Sigstore integration time:
-
Permalink:
theMirmakhmudov/AutoPay-API@377d141f15efe3b89ac9f48993ab0a574b998695 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/theMirmakhmudov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@377d141f15efe3b89ac9f48993ab0a574b998695 -
Trigger Event:
workflow_dispatch
-
Statement type: