In my project, I need to use two telegram bots, which are linked by one database. I faced the following difficulty: having received a photo_id from one bot, I can only use it in this bot, the other bot does not have access to the files.
ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: wrong file identifier/HTTP URL specified
At the same time, exactly the same line of code in the first bot successfully sends a photo
If I try to make an URL with this file, then it is downloaded, therefore, you will not be able to send a photo via the link.
Is it possible to use documents received from another bot without saving them to the database?
Yes... well maybe. Are you trying to avoid writing to the database to avoid writing to the database specifically or are you trying to avoid any further file handling?
If you are trying to avoid the database because its a database - my proposal would need you to create a shared memory space to do so. Maybe others know of easier ways.
Try memcache or redis. Both have python libraries, I'd personally go with redis due to my own experiences.
I don't know what your architecture is like for checking for updates - I assume you have some kind of scheduler ongoing? In which case you check redis/memcache for updates periodically, download/retransmit the data if it exists, then clear it.
How to connect two or more telegram bots for file exchange