[Python] How to display a progress bar while uploading a file to Telegram using Pyrogram?

Discussão em 'Python' iniciado por Stack, Agosto 6, 2025.

  1. Stack

    Stack Membro Participativo

    I'm building a Telegram bot using the Pyrogram library in Python. I want to send large files (like videos or documents) to a user and show a progress bar while the file is uploading.

    Currently, I'm using app.send_document() or app.send_video(), but there's no visual indication or callback to show the progress of the upload to the user.

    I would like to:

    • Show the percentage of the upload (e.g. Uploading: 65%)
    • Optionally edit a message to update the progress in real-time
    • Send the file after the progress reaches 100%
    • Is there any built-in or recommended way to do this using Pyrogram?

    Continue reading...

Compartilhe esta Página