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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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