Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telegram.ext import Updater, CommandHandler
- import os
- def hello(bot, update):
- update.message.reply_text(
- 'Hello {}'.format(update.message.from_user.first_name))
- def sendpict(bot, update):
- chat_id = update.message.chat_id
- print(chat_id)
- bot.send_message(chat_id=chat_id, text="Kondisi Sekarang Aman")
- bot.send_photo(chat_id=chat_id, photo=open('D:/api.jpg', 'rb'))
- updater = Updater('')
- updater.dispatcher.add_handler(CommandHandler('hello', hello))
- updater.dispatcher.add_handler(CommandHandler('mesin1', sendpict))
- updater.start_polling()
- updater.idle()
- print("Ready")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement