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

The library already handles PRocket task sessions for you: it opens sponsor links through the PRocket redirect URL and sends the matching session_token during verification.

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)

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.4.0.tar.gz (5.0 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.4.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for procketapi-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c141c014a88eb72176767df6f5087bfb6f1634d4f916b6c69728c88157d75635
MD5 e911187d0f4269ab18db5572f81f4647
BLAKE2b-256 4af06ff654c68a84fc7f7e9a45ddc6b50c91d1caa4a06dec9dee538ad88dde87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: procketapi-0.4.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72da86ae8e5307a5b48e516f21b14b66180b694bc82268cbec8a6c99a16dfa45
MD5 19aff32c1b71ff36df8c51e5a2431bbb
BLAKE2b-256 1a5453a21514f50189f1afaa818853146113248805939e04418fa163f928affe

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