Skip to main content

python-telegram-client

Build Status PyPI DockerHub Read the Docs (version)

This is a fork of alexander-akhmetov/python-telegram. The root package is renamed from "telegram" to "teleclient" to avoid name conflict with python-telegram-bot.

Installation

This library requires Python 3.6+ and Linux or MacOS.

pip install python-telegram-client

See documentation for more details.

How to use

Have a look at the tutorial :)

Basic example:

from teleclient.client import Telegram
from teleclient.text import Spoiler

tg = Telegram(
    api_id='api_id',
    api_hash='api_hash',
    phone='+31611111111',  # you can pass 'bot_token' instead
    database_encryption_key='changekey123',
    files_directory='/tmp/.tdlib_files/',
)
tg.login()

# if this is the first run, library needs to preload all chats
# otherwise the message will not be sent
result = tg.get_chats()
result.wait()

chat_id: int
result = tg.send_message(chat_id, Spoiler('Hello world!'))
# `tdlib` is asynchronous, so `python-telegram` always returns you an `AsyncResult` object.
# You can receive a result with the `wait` method of this object.
result.wait()
print(result.update)

tg.stop()  # you must call `stop` at the end of the script

More examples you can find in the /examples/ directory.


More information in the documentation.

Development

See CONTRIBUTING.md.

Metadata

Release files for python-telegram-client 0.17.0.post0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-telegram-client 0.17.0.post0
File Size Uploaded
python-telegram-client-0.17.0.post0.tar.gz 15.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-telegram-client 0.17.0.post0
File Interpreter ABI Platform
python_telegram_client-0.17.0.post0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 31.3 MB

Release files / python-telegram-client-0.17.0.post0.tar.gz

Download URL python-telegram-client-0.17.0.post0.tar.gz
Size 15.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b91a1b440374cdbb087da3116e8de59ac8ad0f4a5f124412a710426ea7c301d2
BLAKE2b-256 checksum
How to use checksums
5707b1549360429e68edb747285e746252082d7e5a20212b07d184b9dfb4861d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / python_telegram_client-0.17.0.post0-py2.py3-none-any.whl

Download URL python_telegram_client-0.17.0.post0-py2.py3-none-any.whl
Size 15.7 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
32b845fab177a2500f92199dc0b33ca8d80c06c9cdd010eef2b4074008d6602f
BLAKE2b-256 checksum
How to use checksums
62df410512ea863819067d4d15854dd2dae8d1e943773cb695a6ac0477904813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.17.0.post0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page