mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
Fix stop_transmission example
This commit is contained in:
parent
28cee8d01f
commit
f867c66083
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Reference in a new issue