Improve command handling in PollingBot

This commit is contained in:
netkas 2024-11-04 01:22:30 -05:00
parent a4af8fd1b7
commit 439ccdb123

View file

@ -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