Answer the question
In order to leave comments, you need to log in
How to assign a variable to each answer for further python(aiogram) output?
works on aiogram python , don't know how to use state machine
@dp.message_handler(text=['Online order'])
async def process_command_1(message: types.Message):
await message.reply("Select products :", reply_markup=inline_kb )
@dp.callback_query_handler(lambda c: c.data == 'convert')
async def process_callback_button1(callback_query: types.CallbackQuery , state: FSMContext):
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user .id, 'Number of sides?', reply_markup=inline_kb1)
async with state.proxy() as data:
data['ref1'] = ref_id_1lv
data['ref2'] = ref_id_2lv
@dp.callback_query_handler(lambda c: c.data == 'allpanton')
async def process_callback_button1(callback_query: types.CallbackQuery , state: FSMContext):
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user. id, 'Select size ?', reply_markup=inline_kb2)
@dp.callback_query_handler(lambda c: c.data == 'sizew1')
async def process_callback_button1(callback_query: types.CallbackQuery , state: FSMContext):
await bot.answer_callback_query(callback_query .id)
await bot.send_message(callback_query.from_user.id, 'Choose number ?',reply_markup=inline_kb3)
async with state.proxy() as data:
ref_id_1lv = data['ref1']
ref_id_2lv = data['ref2']
await state.finish()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question