Improve command handling in PollingBot
This commit is contained in:
parent
a4af8fd1b7
commit
439ccdb123
1 changed files with 6 additions and 1 deletions
|
@ -235,14 +235,19 @@
|
||||||
{
|
{
|
||||||
// Check if the update contains a command
|
// Check if the update contains a command
|
||||||
$command = $update?->getAnyMessage()?->getCommand();
|
$command = $update?->getAnyMessage()?->getCommand();
|
||||||
|
$commandExecuted = false;
|
||||||
if ($command !== null)
|
if ($command !== null)
|
||||||
{
|
{
|
||||||
foreach ($this->getEventHandlersByCommand($command) as $commandHandler)
|
foreach ($this->getEventHandlersByCommand($command) as $commandHandler)
|
||||||
{
|
{
|
||||||
(new $commandHandler($update))->handle($this);
|
(new $commandHandler($update))->handle($this);
|
||||||
|
$commandExecuted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
if($commandExecuted)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the update contains a callback query
|
// Check if the update contains a callback query
|
||||||
|
|
Loading…
Add table
Reference in a new issue