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.

Source Distribution

py-telegram-bot-1.0.post3.tar.gz (3.0 kB view hashes)

Uploaded source

Built Distribution

py_telegram_bot-1.0.post3-py3-none-any.whl (16.6 kB view hashes)

Uploaded py3

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