Answer the question
In order to leave comments, you need to log in
How to delete bot message when clicking on inline button?
I want to implement deleting a bot message when clicking on the inline button in a public chat, but an error occurs:
raise err(cls.text or description)
aiogram.utils.exceptions.MessageToDeleteNotFound: Message to delete not found
@dp.message_handler(content_types=['new_chat_members'])
async def on_user_joined(message: types.Message):
await message.reply('текст', reply_markup=urlkb)
urlkb = InlineKeyboardMarkup(row_width=1).add(InlineKeyboardButton(text='принять', callback_data='test'))
@dp.callback_query_handler(text="test")
async def test_call(message: types.Message):
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 questionAsk a Question
731 491 924 answers to any question