From 42c3138d3b3bb12182b490df355271b6de31babe Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 4 Nov 2024 01:19:44 -0500 Subject: [PATCH] Refactor command handling in PollingBot --- src/TgBotLib/PollingBot.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/TgBotLib/PollingBot.php b/src/TgBotLib/PollingBot.php index e9c0f28..df35eab 100644 --- a/src/TgBotLib/PollingBot.php +++ b/src/TgBotLib/PollingBot.php @@ -240,13 +240,10 @@ $commandHandlers = $this->getEventHandlersByCommand($command); foreach ($commandHandlers as $commandHandler) { - /** @var CommandEvent $commandHandler */ - if ($commandHandler::getCommand() === $command) - { - (new $commandHandler($update))->handle($this); - continue 2; - } + (new $commandHandler($update))->handle($this); } + + continue; } // Check if the update contains a callback query