Skip to content

Commit a738e09

Browse files
committed
Make sure we only filter update types that directly call a command
1 parent 75d992c commit a738e09

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/Commands/Command.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,20 @@ public function isUserCommand()
368368
*/
369369
protected function removeNonPrivateMessage()
370370
{
371-
$message = $this->getMessage();
372-
$chat = $message->getChat();
371+
$message = $this->getMessage() ?: $this->getEditedMessage();
372+
373+
if ($message) {
374+
$chat = $message->getChat();
373375

374-
if (!$chat->isPrivateChat()) {
375-
// Delete the falsely called command message.
376-
Request::deleteMessage([
377-
'chat_id' => $chat->getId(),
378-
'message_id' => $message->getMessageId(),
379-
]);
376+
if (!$chat->isPrivateChat()) {
377+
// Delete the falsely called command message.
378+
Request::deleteMessage([
379+
'chat_id' => $chat->getId(),
380+
'message_id' => $message->getMessageId(),
381+
]);
380382

381-
return true;
383+
return true;
384+
}
382385
}
383386

384387
return false;

0 commit comments

Comments
 (0)