All Projects → alexander-akhmetov → Python Telegram

alexander-akhmetov / Python Telegram

Licence: mit
Python client for the Telegram's tdlib

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Telegram

Java Telegram Bot Api
Telegram Bot API for Java
Stars: ✭ 819 (+232.93%)
Mutual labels:  telegram-bot-api, telegram-api, telegram-bot, telegram
Informer
A Telegram Mass Surveillance Bot in Python
Stars: ✭ 745 (+202.85%)
Mutual labels:  telegram-bot-api, telegram-api, telegram-bot, telegram
Telegram
Telegram Bot API Wrapper for Scala
Stars: ✭ 310 (+26.02%)
Mutual labels:  telegram-bot-api, telegram-api, telegram-bot, telegram
Mypackbot
🤖 Your own unlimited pack of Telegram-stickers
Stars: ✭ 18 (-92.68%)
Mutual labels:  telegram-bot-api, telegram-api, telegram-bot, telegram
Zanzara
Asynchronous PHP Telegram Bot Framework built on top of ReactPHP
Stars: ✭ 107 (-56.5%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Rastreiobot
Telegram Bot @RastreioBot
Stars: ✭ 196 (-20.33%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Novagram
An Object-Oriented PHP library for Telegram Bots
Stars: ✭ 112 (-54.47%)
Mutual labels:  telegram-api, telegram-bot, telegram
Botserver
http://telegram.org Bot API Webhooks Framework, for Rubyists
Stars: ✭ 125 (-49.19%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Libtelegram
Fast, efficient, header-only C++ Telegram bot API library using polling or FastCGI
Stars: ✭ 88 (-64.23%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Node Telegram Api
A simple API to create and control Telegram bots
Stars: ✭ 117 (-52.44%)
Mutual labels:  telegram-api, telegram-bot, telegram
Telegram Bot Api
First Telegram Bot API node.js library
Stars: ✭ 205 (-16.67%)
Mutual labels:  telegram-api, telegram-bot, telegram
Vk To Telegram Bot
Bot for auto-reposting posts from VK to Telegram channel
Stars: ✭ 103 (-58.13%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Integram
Integrate Telegram into your workflow – Trello, Gitlab, Bitbucket and other bots
Stars: ✭ 1,365 (+454.88%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Mattata
A powerful, plugin-based, multi-purpose Telegram bot designed to serve a wide variety of purposes
Stars: ✭ 107 (-56.5%)
Mutual labels:  telegram-api, telegram-bot, telegram
Telebot.nim
Async client for Telegram Bot API in pure Nim [Bot API 5.1]
Stars: ✭ 93 (-62.2%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Bot Api Base
Clear and simple Telegram bot API
Stars: ✭ 122 (-50.41%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+799.19%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Teledart
A Dart library interfacing with the latest Telegram Bot API.
Stars: ✭ 142 (-42.28%)
Mutual labels:  telegram-bot-api, telegram-bot, telegram
Core
PHP Telegram Bot based on the official Telegram Bot API
Stars: ✭ 2,899 (+1078.46%)
Mutual labels:  telegram-api, telegram-bot, telegram
Sentry Telegram
Plugin for Sentry which allows sending notification via Telegram messenger.
Stars: ✭ 168 (-31.71%)
Mutual labels:  telegram-api, telegram-bot, telegram

python-telegram

Build Status PyPI DockerHub Read the Docs (version)

Python API for the tdlib library. It helps you build your own Telegram clients.

Installation

This library requires Python 3.6+ and Linux or MacOS.

pip install python-telegram

See documentation for more details.

Docker

This library has a docker image:

docker run -i -t --rm \
            -v /tmp/docker-python-telegram/:/tmp/ \
            akhmetov/python-telegram \
            python3 /app/examples/send_message.py $(API_ID) $(API_HASH) $(PHONE) $(CHAT_ID) $(TEXT)

How to use

Have a look at the tutorial :)

Basic example:

    from telegram.client import Telegram

    tg = Telegram(
        api_id='api_id',
        api_hash='api_hash',
        phone='+31611111111',  # you can pass 'bot_token' instead
        database_encryption_key='changekey123',
    )
    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()

    result = tg.send_message(
        chat_id=args.chat_id,
        text=args.text,
    )
    # `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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].