Answer the question
In order to leave comments, you need to log in
How to save an image in BytesIO?
there is a code snippet from Telegram Bot
def decrypting(message):
detector = cv2.QRCodeDetector()
qr_image = message.photo
bio = BytesIO()
qr_image.save(bio, 'JPEG')
bio.seek(0)
data = detector.detectAndDecode(bio)
bot.send_message(message.chat.id, f'QR code data: \n\n{data}')
Answer the question
In order to leave comments, you need to log in
The photo attribute of the Message class is a list. Read the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question