diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index c13c03b5..14cf2753 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -327,6 +327,7 @@ class Connection extends Session $this->datacenter = $ctx->getDc(); $this->datacenterId = $this->datacenter . '.' . $this->id; $this->API->logger->logger("Connecting to DC {$this->datacenterId}", \danog\MadelineProto\Logger::WARNING); + $this->createSession(); $ctx->setReadCallback([$this, 'haveRead']); $this->stream = (yield from $ctx->getStream()); $this->API->logger->logger("Connected to DC {$this->datacenterId}!", \danog\MadelineProto\Logger::WARNING);