Skip to main content

A lightweight Telegram Gateway API SDK

Project description

tg_gateway is a Python library for interacting with the Telegram Gateway API

Installation

pip install -U tg_gateway

Usage example

import asyncio
import logging
from typing import Final

from tg_gateway import TelegramGateway

API_TOKEN: Final[str] = "YOUR_TOKEN_HERE"


async def main() -> None:
    logging.basicConfig(level=logging.DEBUG)
    gateway: TelegramGateway = TelegramGateway(api_token=API_TOKEN, force_detailed_errors=True)
    result = await gateway.send_verification_message(
        phone_number="+88812956932",
        code_length=8,
        callback_url="https://example.com",
    )
    logging.info(result)
    await gateway.session.close()


if __name__ == "__main__":
    asyncio.run(main())

Contact

For any questions or feedback, feel free to reach out to me on my Telegram

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

tg_gateway-1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

tg_gateway-1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file tg_gateway-1.0.tar.gz.

File metadata

  • Download URL: tg_gateway-1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for tg_gateway-1.0.tar.gz
Algorithm Hash digest
SHA256 91ebd766f06d8ec24116d5b23ee03886b597021765971ac0acffd7120d09127d
MD5 078dec9afb7e6ed61d5c3b1624f06fa0
BLAKE2b-256 f44311b6b14ef7f7ce21b64914295092434e56cb231d1a1f91eecf26a09cdb3f

See more details on using hashes here.

File details

Details for the file tg_gateway-1.0-py3-none-any.whl.

File metadata

  • Download URL: tg_gateway-1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for tg_gateway-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6853c3421f71cb8723f15835bd120887ca39607e71f257cfbee912625808fa2
MD5 4174a3d211606d747dbcbe5ef4dfffc3
BLAKE2b-256 af91ed00f818249823cf3500bf2a464927e9e31a92be6776784b97b7d572c89d

See more details on using hashes here.

Supported by

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