File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments