Skip to content

Commit 118cd04

Browse files
committed
Document DisconnectHandler
1 parent 0dc5ecf commit 118cd04

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

pyrogram/client/handlers/disconnect_handler.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020

2121

2222
class DisconnectHandler(Handler):
23-
# TODO: Documentation
23+
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
24+
:meth:`add_handler() <pyrogram.Client.add_handler>`
25+
26+
27+
Args:
28+
callback (``callable``):
29+
Pass a function that will be called when a disconnection occurs. It takes *(client)*
30+
as positional argument (look at the section below for a detailed description).
31+
32+
Other parameters:
33+
client (:obj:`Client <pyrogram.Client>`):
34+
The Client itself. Useful, for example, when you want to change the proxy before a new connection
35+
is established.
36+
"""
2437
def __init__(self, callback: callable):
2538
super().__init__(callback)

0 commit comments

Comments
 (0)