From 6b63e88de7e42ebfc1aa20433154750d82533ce5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 11 Jan 2019 14:02:40 +0100 Subject: [PATCH] Add Client.stop_transmission() method As a wrapper for raise StopTransmission --- pyrogram/client/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 2a3a420d..b8e310a5 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -460,6 +460,12 @@ class Client(Methods, BaseClient): else: self.dispatcher.remove_handler(handler, group) + def stop_transmission(self): + """Use this method to stop downloading or uploading a file. + Must be called inside a progress callback function. + """ + raise Client.StopTransmission + def authorize_bot(self): try: r = self.send(