Skip to main content

A Telegram-based automated payment detection system

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 payment systems (Click, Payme, Uzcard, Humo) on behalf of merchants. It acts as an integration middleware, parsing transaction SMS/Messages 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 regex to interpret and normalize transaction amounts from Click, Payme, Uzcard, and Humo 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, since popular Uzbek banking apps don't support fractional inputs.
  • Webhook Integration: Instantly fires asynchronous HTTP webhooks signed with an HMAC (SHA-256) signature.
  • Background Health Checking: Asynchronous daemon runs every 5 minutes to verify if merchant sessions have been revoked.

🚀 Installation & Usage

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 command acts as a setup wizard. It 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 database:

autopay upgrade

4. Run the System

You no longer need to open two terminals! 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 (One-Click)

Don't want to install Python packages directly or want to deploy to a Linux server safely? You can use our interactive Docker scaffolding tool!

Simply run:

autopay deploy

This command will instantly generate a production-ready docker-compose.yml file pointing to our official GitHub Container Registry image (ghcr.io/themirmakhmudov/autopaybot:latest).

Then, just bring it up:

docker-compose up -d

Testing & Development

To contribute or run automated tests locally:

git clone https://github.com/theMirmakhmudov/AutoPay-API.git
cd AutoPay-API/backend

# Install with development dependencies
pip install -e .[dev]

# Run tests
pytest tests/ -v

License

MIT License. See the LICENSE file for details. Note: 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autopaybot-0.1.4.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autopaybot-0.1.4-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file autopaybot-0.1.4.tar.gz.

File metadata

  • Download URL: autopaybot-0.1.4.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autopaybot-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3f52647dfd9b54fb3ba8882ed30642080a5bd0f9469b01bd5ddc321b454cfc33
MD5 7dd4ccd6f4d02b0d1c0b3caa6af09455
BLAKE2b-256 f29a84f2cc463e5f02fab160c6817423b49b8dae697c7e7d676db97d28dfd548

See more details on using hashes here.

Provenance

The following attestation bundles were made for autopaybot-0.1.4.tar.gz:

Publisher: publish.yml on theMirmakhmudov/AutoPay-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autopaybot-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: autopaybot-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autopaybot-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f7d343f15e70adb3d653fe0aed7f3c2c419c1d61132e4b9432f840fc72de44e2
MD5 d501596f337c00519561fe693f7fa9db
BLAKE2b-256 36ccb3ff6a72168047b0cc034a4679eeb642af48ec1cdee8d14cc0c8f1a9de4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for autopaybot-0.1.4-py3-none-any.whl:

Publisher: publish.yml on theMirmakhmudov/AutoPay-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page