Skip to content

Commit

Permalink
Feat: upgrade madelineProto
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Aug 18, 2024
1 parent 0e3dd47 commit ce6f8a0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"amphp/websocket-server": "^3.0.1",
"amphp/websocket-client": "^v2",
"vlucas/phpdotenv": "^4.3",
"danog/madelineproto": "dev-v8_fix_cleanup",
"danog/madelineproto": "dev-v8-tas",
"amphp/dns": "2.x-dev"
},
"require-dev": {
Expand Down
66 changes: 33 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use ReflectionProperty;
use Revolt\EventLoop;
use RuntimeException;
use TelegramApiServer\EventObservers\EventHandler;
use TelegramApiServer\EventObservers\EventObserver;

final class Client
Expand Down Expand Up @@ -148,11 +149,7 @@ private function startNotLoggedInSessions(): void
public function startLoggedInSession(string $sessionName): void
{
if ($this->instances[$sessionName]->getAuthorization() === API::LOGGED_IN) {
if (
$this->instances[$sessionName]->getEventHandler() instanceof \__PHP_Incomplete_Class
) {
$this->instances[$sessionName]->unsetEventHandler();
}
EventHandler::cachePlugins(EventHandler::class);
$this->instances[$sessionName]->start();
$this->instances[$sessionName]->echo("Started session: {$sessionName}\n");
}
Expand Down

0 comments on commit ce6f8a0

Please sign in to comment.