I created a telegram bot to analyze user texts. Now I want to add the ability to process a pdf-file after clicking on the “Document Analysis” button. But I have no idea how to solve this problem, searching the Internet does not give a good result. ChatGPT doesn’t give good results either
I use the aiogram library
logging.basicConfig(level = logging.INFO)
bot = Bot(token=config.bot_token.get_secret_value())
dp = Dispatcher()
@dp.message(Command("start"))
async def cmd_start(message: types.Message):
kb = [
[
types.KeyboardButton(text = "Text analysis"),
types.KeyboardButton(text = "Document analysis")
],
]
keyboard = types.ReplyKeyboardMarkup(
keyboard = kb,
resize_keyboard = True,
input_field_placeholder = "Select the method of text transmission for analysis"
)
await message.answer(f"Hello",
reply_markup=keyboard)
users_state = {}
@dp.message(F.text == "Text analysis")
async def without_puree(message: types.Message):
users_state[message.from_user.id] = "waiting_for_text"
await message.answer("Enter the text")
Can anyone share a suitable code?