I get the same problem when doing the demo, that's why I simplified it.
def add_media(update: Update, context: CallbackContext): logger.info(f"El usuario {update.effective_user['username']}, subió foto") quote = context.user_data["new_quote"] photo = context.bot.getFile(update.message.photo[-1].file_id) file_ = open("product_image", "wb") photo.download(out=file_) send_photo = upload("product_image", width=200, height=150, crop='thumb')
dp.add_handler(ConversationHandler( entry_points = [CommandHandler("new", handlers.start)], states={ handlers.QUOTE: [ MessageHandler( Filters.all, handlers.add_quote ) ], handlers.MEDIA: [ MessageHandler(Filters.photo, handlers.add_media) ] }, fallbacks=[CommandHandler('cancel', handlers.cancel)], allow_reentry=True) )
The console show the same error:
ValueError: not enough values to unpack (expected 2, got 1)
I know the error is upload because when I remove it the error does not appear.
upload
I see, do you add caption to the image when you test it though.?
Could you check my code and see if there is something I am doing wrong?
github.com/alvaaz/telegram_bot
I would really appreciate it
oh great!, thanks for making this easier I'll take a look
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I get the same problem when doing the demo, that's why I simplified it.
The console show the same error:
I know the error is
upload
because when I remove it the error does not appear.I see, do you add caption to the image when you test it though.?
Could you check my code and see if there is something I am doing wrong?
github.com/alvaaz/telegram_bot
I would really appreciate it
oh great!, thanks for making this easier I'll take a look