How can I do this: I got my tgbot using aiogram
and I need this bot to handle replied messages. For example: A user in chat replied some message and the bot should handle the users message and also the message that user replied.
I've tried:
@dp.message_handler(lambda message: message.chat.id == chat_id, commands='add')
async def add_to_db(message: types.Message, state: FSMContext):
await bot.send_message(message.chat.id, 'Сейчас добавлю')
await bot.send_message(message.chat.id, message.text)
await state.finish()
That code reacts to command 'add'
, and I need the bot to learn which message was replied with this command.