Skip to content
This repository was archived by the owner on Jun 2, 2019. It is now read-only.

on query after another #464

@eenvid

Description

@eenvid

hi
I want to run a query after another query.

`
def on_chat_message(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
keyboard = InlineKeyboardMarkup(inline_keyboard=[
[InlineKeyboardButton(text='ISO', callback_data='iso')],
[InlineKeyboardButton(text='MAKRO', callback_data='makro')],
])
bot.sendMessage(chat_id, 'please select one', reply_markup=keyboard)

def menu(msg):
query_id, from_id, query_data = telepot.glance(msg, flavor='callback_query')

if  query_data=='makro':
     keyboard = InlineKeyboardMarkup(inline_keyboard=[
               [InlineKeyboardButton(text='number 1', callback_data='1')],
               [InlineKeyboardButton(text='number 2', callback_data='2')],   
           ])
    bot.sendMessage(from_id,'please select one, reply_markup=keyboard)
    
    
if  query_data=='iso':
         keyboard = InlineKeyboardMarkup(inline_keyboard=[
               [InlineKeyboardButton(text='number 3', callback_data='3')],
               [InlineKeyboardButton(text='number 4', callback_data='4')],   
           ])
    bot.sendMessage(from_id,'please select one, reply_markup=keyboard)

bot = telepot.Bot(TOKEN)
MessageLoop(bot, {'chat': on_chat_message,
'callback_query': menu}).run_as_thread()

`

And according to what the user chooses in the second query, one number will be displayed.

I wrote the code above and I'll go to the second menu stage.
But after that, I do not know what to do, so the program proceeds according to the user's choice in the second menu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions