Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telegram import *
- from telegram.ext import *
- def start(update, context):
- keyboard = InlineKeyboardMarkup([ [InlineKeyboardButton("1", callback_data='ONE'), InlineKeyboardButton("2", callback_data='TWO')] ])
- update.message.reply_text("Start handler, Choose a route", reply_markup=keyboard)
- def button(update, context):
- query = update.query
- if query.data == 'ONE':
- query.message.reply_text('eblan')
- def main():
- updater = Updater("929415843:AAFwCHdkLGncYb6kyOaghcmhJodF986j3Ns", use_context=True)
- dp = updater.dispatcher
- updater.start_polling(clean=True)
- dp.add_handler(CommandHandler("start", start))
- dp.add_handler(CallbackQueryHandler(button))
- updater.start_polling(clean=True)
- updater.idle()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement