From 439ccdb123029df3ab8b4292f503c1506dcec7ea Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 4 Nov 2024 01:22:30 -0500 Subject: [PATCH] Improve command handling in PollingBot --- src/TgBotLib/PollingBot.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TgBotLib/PollingBot.php b/src/TgBotLib/PollingBot.php index f3e93fc..6632a46 100644 --- a/src/TgBotLib/PollingBot.php +++ b/src/TgBotLib/PollingBot.php @@ -235,14 +235,19 @@ { // Check if the update contains a command $command = $update?->getAnyMessage()?->getCommand(); + $commandExecuted = false; if ($command !== null) { foreach ($this->getEventHandlersByCommand($command) as $commandHandler) { (new $commandHandler($update))->handle($this); + $commandExecuted = true; } - continue; + if($commandExecuted) + { + continue; + } } // Check if the update contains a callback query