Skip to main content

Telegram Bots API wrapper.

Project description

Getting new messages and answer

from import Bot

bot = Bot('Token')
api = bot.get_api()

for update in bot.get_updates():
    # Here you can use "update['text']"
    if update.text == '/start':
        # And here you can use "update['chat']['id']"

Uploading photo, videos or docs

from import Bot

bot = Bot('Token')
uploader = bot.get_uploader()

for update in bot.get_updates():
    if update.text == 'video':
        # or use here video id
        open('video.mp4', 'rb'))
    elif update.text == 'photo':
        # or use here photo id
        open('photo.png', 'rb'))
    elif update.text == 'doc':
        # or use here doc id
        open('', 'rb'))

Project details

Download files

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

Files for py-telegram-bot, version 1.0.post3
Filename, size File type Python version Upload date Hashes
Filename, size py_telegram_bot-1.0.post3-py3-none-any.whl (16.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size py-telegram-bot-1.0.post3.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page