Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. from telegram import *
  2. from telegram.ext import *
  3.  
  4. def start(update, context):
  5. keyboard = InlineKeyboardMarkup([ [InlineKeyboardButton("1", callback_data='ONE'), InlineKeyboardButton("2", callback_data='TWO')] ])
  6. update.message.reply_text("Start handler, Choose a route", reply_markup=keyboard)
  7.  
  8. def button(update, context):
  9. query = update.query
  10. if query.data == 'ONE':
  11. query.message.reply_text('eblan')
  12. def main():
  13. updater = Updater("929415843:AAFwCHdkLGncYb6kyOaghcmhJodF986j3Ns", use_context=True)
  14. dp = updater.dispatcher
  15. updater.start_polling(clean=True)
  16. dp.add_handler(CommandHandler("start", start))
  17. dp.add_handler(CallbackQueryHandler(button))
  18. updater.start_polling(clean=True)
  19. updater.idle()
  20.  
  21. if __name__ == '__main__':
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement