Advertisement
aproxtime

tele

Jul 6th, 2019
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. from telegram.ext import Updater, CommandHandler
  2. import os
  3.  
  4. def hello(bot, update):
  5.     update.message.reply_text(
  6.         'Hello {}'.format(update.message.from_user.first_name))
  7.  
  8. def sendpict(bot, update):
  9.     chat_id = update.message.chat_id
  10.     print(chat_id)
  11.     bot.send_message(chat_id=chat_id, text="Kondisi Sekarang Aman")
  12.     bot.send_photo(chat_id=chat_id, photo=open('D:/api.jpg', 'rb'))
  13.  
  14. updater = Updater('')
  15.  
  16. updater.dispatcher.add_handler(CommandHandler('hello', hello))
  17. updater.dispatcher.add_handler(CommandHandler('mesin1', sendpict))
  18.  
  19. updater.start_polling()
  20. updater.idle()
  21. print("Ready")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement