Refactor command handling in PollingBot
This commit is contained in:
parent
e2bc3010af
commit
42c3138d3b
1 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue