Salz0 / telegram_flea

A open-source flea market bot, to be used in any Community
MIT License
9 stars 21 forks source link

Accept photos as files #14 #26

Closed kamo-develop closed 10 months ago

kamo-develop commented 10 months ago

The bot now accepts photos as files #14

kamo-develop commented 10 months ago

Sorry, there was a conflict in the code because I added the publish_post and enter_photo_as_document functions

hexponent commented 10 months ago

@kamo-develop If we need to add extra step after photo, we would have to make changes in both enter_photo and enter_photo_as_document, so I suggest moving common logic (file download + post) in separate handle_photo which accepts either document or photo[-1]

kamo-develop commented 10 months ago

@hexponent Ok, I'll do it. I will create a new PR later.

mykolasolodukha commented 10 months ago

@kamo-develop LGTM 👍

I would also propose adding a check for files so that e.g. .pdf files are not saved as .jpgs. However, it's optional at this stage.

Looking forward to more contributions from you!