This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telegram | |
def main(): | |
bot = telegram.Bot(token="128535145:AAG6gTZYlAjbIeQmy-r3ZtG_pnBpi7hJSAQ") | |
lui = bot.getUpdates()[-1].update_id | |
print lui | |
while True: | |
for updates in bot.getUpdates(offset=lui,timeout=10): | |
text = updates.message.text | |
chat_id = updates.message.chat.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telegram | |
bot = telegram.Bot(token='94659039:AAGxm7YBCKonO9DYtusYWBnbG1Ve8BjK3iM') | |
print bot.getMe() | |
updates = bot.getUpdates() | |
print [u.message.text for u in updates] | |
updates = bot.getUpdates() | |
print [u.message.photo for u in updates if u.message.photo] |