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

on query after another #464

Open
eenvid opened this issue May 10, 2019 · 0 comments
Open

on query after another #464

eenvid opened this issue May 10, 2019 · 0 comments

Comments

@eenvid
Copy link

eenvid commented May 10, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant