F
F
F111FF2021-12-14 13:03:47
Python
F111FF, 2021-12-14 13:03:47

How to find message.message.message_id?

The bot should delete its previous message after the user's response.
But an error occurs:
AttributeError: 'Message' object has no attribute 'message'

I tried to change something, but the above error comes out or:
aiogram.utils.exceptions.MessageToDeleteNotFound: Message to delete not found

What can I do?

@dp.message_handler(content_types=["text"], state="waitText")
async def result(message: types.Message, state: FSMContext):
    await bot.delete_message(message.from_user.id, message.message.message_id)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question