S
S
szjyakgf2022-02-12 14:05:52
Python
szjyakgf, 2022-02-12 14:05:52

How to call a function in inline mode?

I have a function:

@dp.message_handler(commands=['start'])
async def start(message: types.Message):
  my_new_message = await bot.send_message(message.chat.id, 'Ждем: 2сек')
  await sleep(1)
  await bot.edit_message_text(chat_id=message.chat.id, message_id=my_new_message.message_id, text='Ждем: 1сек')
  await sleep(1)
  await bot.edit_message_text(chat_id=message.chat.id, message_id=message.message_id, text='Готово')

how to call it through inline mode?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2022-02-12
@szjyakgf

No way, inline mode is not intended for this.
Inline mode is a means of assisting the user in typing a message. A request arrives in the bot, which it analyzes and issues a list of options. This list is then cached and may not be called for some time with the same parameters by the user of a real request to the bot. The bot cannot change already sent answers for inline mode. Find out whether the user sent messages as a result and in which chat he also does not have the opportunity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question