Guest User

Untitled

a guest
Nov 22nd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import telegram
  2. from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
  3. import requests,json
  4. from photo2Down import Photo2Down
  5. TOKEN = "YOUR_TOKEN"
  6. updater = Updater(token=TOKEN)
  7. dispatcher = updater.dispatcher
  8.  
  9. photo_wrapper = Photo2Down(TOKEN)
  10. def Start(bot, update):
  11.  
  12. bot.sendMessage(chat_id=update.message.chat_id, text = "Hello Test.")
  13.  
  14. def test2(bot,update):
  15.  
  16. file_id = update.message.photo[2].file_id ##picture_id
  17. photo_wrapper.download(file_id)
  18.  
  19. dispatcher.add_handler(MessageHandler(Filters.photo, test2))
  20. updater.start_polling()
Add Comment
Please, Sign In to add comment