M
M
Mag1str2021-05-23 10:34:01
Python
Mag1str, 2021-05-23 10:34:01

How to delete your message with a telegram bot?

There is such a code, but it does not work.

if call.data == 'cancel_dice':
        await bot.delete_message(chat_id=chat_id, message_id=message_id)
        await bot.clear_step_handler_by_chat_id(chat_id)

60aa0561ce805786440052.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeniy _, 2021-05-25
@GeneD88

Check that the bot has all the parva to listen and delete all messages and run without await:

if call.data == 'cancel_dice':
        bot.delete_message(chat_id, message_id)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question