Skip to content

Commit 06099b1

Browse files
committed
Non-existing commands should execute GenericCommand.
1 parent 75fc62e commit 06099b1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1212
### Deprecated
1313
### Removed
1414
### Fixed
15+
- Non-existing commands now correctly execute `GenericCommand` again.
1516
### Security
1617

1718
## [0.59.1] - 2019-07-18

src/Telegram.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,9 @@ public function processUpdate(Update $update)
468468

469469
// Empty usage string denotes a non-executable command.
470470
// @see https://github.com/php-telegram-bot/core/issues/772#issuecomment-388616072
471-
if ($command_obj !== null && $command_obj->getUsage() !== '') {
471+
if (($command_obj === null && $type === 'command')
472+
|| ($command_obj !== null && $command_obj->getUsage() !== '')
473+
) {
472474
$command = $command_tmp;
473475
}
474476
} else {

0 commit comments

Comments
 (0)