Refactor command handler invocation in PollingBot
This commit is contained in:
parent
42c3138d3b
commit
a4af8fd1b7
1 changed files with 1 additions and 2 deletions
|
@ -237,8 +237,7 @@
|
||||||
$command = $update?->getAnyMessage()?->getCommand();
|
$command = $update?->getAnyMessage()?->getCommand();
|
||||||
if ($command !== null)
|
if ($command !== null)
|
||||||
{
|
{
|
||||||
$commandHandlers = $this->getEventHandlersByCommand($command);
|
foreach ($this->getEventHandlersByCommand($command) as $commandHandler)
|
||||||
foreach ($commandHandlers as $commandHandler)
|
|
||||||
{
|
{
|
||||||
(new $commandHandler($update))->handle($this);
|
(new $commandHandler($update))->handle($this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue