mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Fix stop_transmission example
This commit is contained in:
parent
28cee8d01f
commit
f867c66083
@ -1101,12 +1101,12 @@ class Client(Methods, BaseClient):
|
|||||||
|
|
||||||
# Example to stop transmission once the upload progress reaches 50%
|
# Example to stop transmission once the upload progress reaches 50%
|
||||||
# Useless in practice, but shows how to stop on command
|
# Useless in practice, but shows how to stop on command
|
||||||
def progress(client, current, total):
|
def progress(current, total, client):
|
||||||
if (current * 100 / total) > 50:
|
if (current * 100 / total) > 50:
|
||||||
client.stop_transmission()
|
client.stop_transmission()
|
||||||
|
|
||||||
with app:
|
with app:
|
||||||
app.send_document("me", "files.zip", progress=progress)
|
app.send_document("me", "files.zip", progress=progress, progress_args=(app,))
|
||||||
"""
|
"""
|
||||||
raise Client.StopTransmission
|
raise Client.StopTransmission
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user