U
U
Urarapha2021-10-28 11:38:01
Python
Urarapha, 2021-10-28 11:38:01

The bot responds to all images sent by the user, how to make it respond with a different option to subsequent ones?

The bot responds to all images sent by the user.
How to make it answer once to a specific one.
In the right place, if then you need to take another image, so that the answer is different and the result is written in the trace of the function?

@dp.message_handler(lambda message: message.text == "Отправить фото")
async def getPhoto(message: types.Message):
    await message.reply('Ждем фото', reply_markup= Avatar) 

@dp.message_handler(content_types=['photo'])
async def handle_docs_photo(message: types.Message):
        idphoto= 1
        chat_id = str(message.chat.id)
        username = str(message.chat.username)
        fileid = str(random.randint(1,20000000))
        messageid = str(message.message_id)
        await message.photo[-1].download(chat_id +username + fileid + messageid + ".jpg")
        await message.reply('Отлично!', reply_markup= level1menu)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question