Skip to main content

PRocket integration library for Telegram bots

Project description

PRocket API Library

This package is prepared for simple installation as:

python -m pip install procketapi

Important: this short command starts working only after you publish the package to PyPI.

For the service owner

You run the PRocket backend on your own server:

  1. python main.py
  2. python -m integration_service.api_server

The connected bot owner does not run your backend. They only:

  1. get an approved API key
  2. get your public base_url
  3. install your library
  4. add the integration into their own bot

Recommended import

from procketapi import PRocketAiogramIntegration

Compatibility imports also work:

from procket_integration import PRocketAiogramIntegration
from procket_integration_sdk import PRocketAiogramIntegration

Easy aiogram integration

from aiogram import F, Router
from aiogram.types import CallbackQuery, Message
from procketapi import PRocketAiogramIntegration

router = Router()
integration = PRocketAiogramIntegration(
    api_key="YOUR_API_KEY",
    base_url="https://your-public-api.example.com",
    callback_prefix="sponsor",
    currency="RUB",
)


@router.message(F.text == "📢 Задания от спонсоров")
async def sponsor_tasks(message: Message):
    await integration.show_tasks(message)


@router.callback_query(F.data.startswith("sponsor:"))
async def sponsor_callbacks(call: CallbackQuery):
    await integration.handle_callback(call)

Until the package is published

Before PyPI publication, installation is possible from a local wheel:

python -m pip install ./procketapi-0.3.0-py3-none-any.whl

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

procketapi-0.3.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

procketapi-0.3.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file procketapi-0.3.0.tar.gz.

File metadata

  • Download URL: procketapi-0.3.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for procketapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7bd95a8904cb7eacc4fc914e49f432d92d6a00a1e076f045e649926b6803d935
MD5 23d3bc8b0c393297b480b80cd1c93cbf
BLAKE2b-256 0ec70a9fe4d1fe78e1fe0d577da34c1f13f03d5f57fecd4647716fd9284087b2

See more details on using hashes here.

File details

Details for the file procketapi-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: procketapi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for procketapi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b70b61cfa311ac8118b6f90665991ef6e17c88f5a194811cd10d39b09b1293e
MD5 71d7b8951243e970c23743334c8e5a40
BLAKE2b-256 0e1040fa011d3f8b796aa728eeabe007deebc9637b29db3edbcc6f9058ea510d

See more details on using hashes here.

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