Getting new messages and answer
from py_telegram_bot.bot import Bot
bot = Bot('Token')
api = bot.get_api()
for update in bot.get_updates():
if update.text == '/start':
api.send_message(chat_id=update.chat.id,
text='Hello!')
Uploading photo, videos or docs
from py_telegram_bot.bot import Bot
bot = Bot('Token')
uploader = bot.get_uploader()
for update in bot.get_updates():
if update.text == 'video':
uploader.send_video(update.chat.id,
open('video.mp4', 'rb'))
elif update.text == 'photo':
uploader.send_photo(update.chat.id,
open('photo.png', 'rb'))
elif update.text == 'doc':
uploader.send_photo(update.chat.id,
open('doc.zip', 'rb'))