python - How to send photo on telegram bot - Stack Overflow

PHOTO EMBED

Mon Aug 15 2022 19:31:09 GMT+0000 (Coordinated Universal Time)

Saved by @GEKKAKING #python

import sys
import time
import random
import datetime
import telepot

def handle(msg):
    chat_id = msg['chat']['id']
    command = msg['text']

    print 'Got command: %s' % command

    if command == 'command1':
        bot.sendMessage(chat_id, *******)
    elif command == 'command2':
        bot.sendMessage(chat_id, ******)
    elif command == 'photo':
        bot.sendPhoto(...)

bot = telepot.Bot('*** INSERT TOKEN ***')
bot.message_loop(handle)
print 'I am listening ...'

while 1:
    time.sleep(10)
content_copyCOPY

https://stackoverflow.com/questions/36778321/how-to-send-photo-on-telegram-bot