Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updater = Updater(TOKEN)
- def bottom(bot, update):
- global command
- print("botoom function called")
- counter = 0
- keyboard_list = [[KeyboardButton("about us")],
- [KeyboardButton("MBTI test")]]
- markup = ReplyKeyboardMarkup(keyboard_list)
- chat_id = update.message.chat_id
- bot.sendMessage(chat_id=chat_id,text='Hi welcome to my bot',reply_markup=markup)
- def news(bot,update):
- option = update.message.text
- chat_id = update.message.chat_id
- print ("new function run")
- print (option)
- if option == 'about us':
- keyboard_list = [[KeyboardButton("return")]]
- markup = ReplyKeyboardMarkup(keyboard_list)
- if option == 'return':
- updater.dispatcher.add_handler(MessageHandler([Filters.text],bottom))
- bot.sendMessage(chat_id,text='you chose about us',reply_markup=markup)
- elif option == 'MBTI test':
- bot.sendMessage(chat_id,'you chose mbti test')
- updater.dispatcher.add_handler(CommandHandler('start',bottom))
- updater.dispatcher.add_handler(MessageHandler([Filters.text], news))
- updater.start_polling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement