Refactor command handler invocation in PollingBot

This commit is contained in:
netkas 2024-11-04 01:20:06 -05:00
parent 42c3138d3b
commit a4af8fd1b7

View file

@ -237,8 +237,7 @@
$command = $update?->getAnyMessage()?->getCommand();
if ($command !== null)
{
$commandHandlers = $this->getEventHandlersByCommand($command);
foreach ($commandHandlers as $commandHandler)
foreach ($this->getEventHandlersByCommand($command) as $commandHandler)
{
(new $commandHandler($update))->handle($this);
}