How do I send an image using file open with python

2019-08-10 10:31发布

问题:

I'm trying to send an image from my drive to telegram using the method sendPhoto but I can't. Which is the trick ?

I'm using Python 3.6.7 My code is as follows:

import sys
import telepot
import aiohttp
import asyncio
import os
import time 

bot = telepot.Bot('55615????:AA????)
bot.getMe()
id=32????
bot.sendPhoto(chatId, str(open("th-623777.jpg", os.O_RDONLY)) )
标签: telepot