code: def on_disconnect(self=None) -> callable:
          
  
          def decorator(func: callable) -> Handler:
              handler = pyrogram.DisconnectHandler(func)
  
              if self is not None:
                  self.add_handler(handler)
  
              return handler
  
          return decorator
docs: Use this decorator to automatically register a function for handling disconnections.
          This does the same thing as :meth:`add_handler` using the :class:`DisconnectHandler`.