Commit a738e09c authored by Jack'lul's avatar Jack'lul

Make sure we only filter update types that directly call a command

parent 75d992c3
...@@ -368,17 +368,20 @@ abstract class Command ...@@ -368,17 +368,20 @@ abstract class Command
*/ */
protected function removeNonPrivateMessage() protected function removeNonPrivateMessage()
{ {
$message = $this->getMessage(); $message = $this->getMessage() ?: $this->getEditedMessage();
$chat = $message->getChat();
if ($message) {
$chat = $message->getChat();
if (!$chat->isPrivateChat()) { if (!$chat->isPrivateChat()) {
// Delete the falsely called command message. // Delete the falsely called command message.
Request::deleteMessage([ Request::deleteMessage([
'chat_id' => $chat->getId(), 'chat_id' => $chat->getId(),
'message_id' => $message->getMessageId(), 'message_id' => $message->getMessageId(),
]); ]);
return true; return true;
}
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment