Answer the question
In order to leave comments, you need to log in
How to get the text of the message to which the inline keyboard is attached?
How to get the text of a message that has an inline keyboard attached to it?
I tried this but it only works if after sending the message to restart the bot
@dp.callback_query_handler(lambda c: c.data == 'button8')
async def process_callback_button1(callback_query: types.CallbackQuery):
await bot.send_message(callback_query.from_user.id, callback_query['message']['text'])
Answer the question
In order to leave comments, you need to log in
Well, since callback_query.message.text does not show, then the maximum is still possible: 1) Store messages separately somewhere in the database. 2) When creating an inline button, set the callback value = text value + some kind of separator character set + other important callback info. For example callback = "Hello everyone/asdgse/StartTime". And then, when reading, you can get the text through .split('/asdgse/'), as a set of separator characters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question