telepot

What's the structure of Telegram's updates to webhook Flask app?

梦想的初衷 提交于 2019-12-11 07:48:53
问题 I'm trying to program a Telegram bot using webhook in a Flask app with telepot, in PythonAnywhere. And so, I want to know what's the structure of the updates comming from Telegram, so as to know what's there and how is it called, and use it in the bot, essentially. I've tried to log the message it receives to the console (though I'm not sure where the console should be on PythonAnywhere), and also to write in a file in the same server, through python, but that's not working either. #This that

How do I send an image using file open with python an telepot?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 06:00:19
问题 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)) ) 来源: https://stackoverflow.com/questions/53860243/how-do-i-send-an-image-using-file-open-with-python-an-telepot