Telegram Bot Unable to Reuse Previous Day's File ID

Using a file ID saved a day earlier triggers a ‘Bad Request’ error, yet forwarding the image again works.

Example code:

image_ref = alt_db['img_ref']
await bot_handler.send_pic(callback.user_id, image_ref, caption='snapshot', reply_markup=make_menu())

i’ve seen this happen; file ids sometimes expire quickly. maybe try to use a fresh upload instead of a saved id. hope it helps, im encountering similar weird behavour sometimes!

I encountered this issue with my bot as well. In my experience, Telegram’s file IDs do not always remain valid over time, even though the documentation might imply a longer lifespan. I noticed that reuploading the file consistently produced a new valid file ID. It appears that the mechanism behind file ID persistence might involve hidden expiry settings, leading to unexpected behavior when using older references. Considering this, generating a fresh file ID when needed seems to be a more reliable approach than trying to reuse previous ones.