Closed renrayut closed 5 years ago
Now you can share photos with the bot and it will download them. Try the new version.
Dear Alfem thanks you for reply . but it still got error
Traceback (most recent call last):
File "telegram-bot.py", line 116, in
or i need to update something more? please guide thanks you
this error show after download send photo done then try to send as attach file it got this error.
it working , i just add this line :
try:
today = date.today()
photos=update.message.photo # a list of different available sizes
if photos:
photo=photos[-1]
d4 = today.strftime("%b-%d-%Y")
name="{}-{}-{}x{}.jpg".format(d4,update.update_id,photo.width,photo.height)
#bot.send_message(chat_id=TELEGRAM_CHAT_ID, text="Downloading photo %s (%i bytes)" %(name, photo.file_size))
tfile=bot.getFile(photo.file_id)
filenames.append(name)
urls.append(tfile.file_path)
except AttributeError:
print "Error in photo message"
pass
thanks you for your script
this script can download attach file only . please help guide to download send as photo.