0

It is necessary for me that depending on the previous message the photo was processed or not. How to implement this in pyTelegramBotAPI?

There is a function that processes a photo or document after it is sent to the chat

@bot.message_handler(content_types=['photo', 'document'])
def photo_processing(message):
   ...

I want to implement such a construction inside this function

if previous_message == "1":
   ...
else: 
   ...

In other words, I need a bool flag that changes depending on the previous message

  • I didn't use this API a lot, but you can try with lambda function in your callback. Refer to this -> https://stackoverflow.com/questions/51611532/how-to-get-chat-id-and-message-id-in-telebotpytelegrambotapi-to-update-last-se – mutantkeyboard Sep 12 '22 at 14:07

0 Answers0