From c37c17dc575287d058f0f998f5b8962a1429e34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20L=C3=BCscher?= Date: Wed, 2 Aug 2017 15:16:15 +0200 Subject: [PATCH] Send /cleanup response to private user chat instead of current chat. --- src/Commands/AdminCommands/CleanupCommand.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Commands/AdminCommands/CleanupCommand.php b/src/Commands/AdminCommands/CleanupCommand.php index 4324be9b1..171da4d83 100644 --- a/src/Commands/AdminCommands/CleanupCommand.php +++ b/src/Commands/AdminCommands/CleanupCommand.php @@ -351,20 +351,14 @@ public function executeNoDb() public function execute() { $message = $this->getMessage(); - $chat_id = $message->getChat()->getId(); + $user_id = $message->getFrom()->getId(); $text = $message->getText(true); $data = [ - 'chat_id' => $chat_id, + 'chat_id' => $user_id, 'parse_mode' => 'Markdown', ]; - if (!$message->getChat()->isPrivateChat()) { - $data['text'] = '/cleanup command is only available in a private chat.'; - - return Request::sendMessage($data); - } - $settings = $this->getSettings($text); $queries = $this->getQueries($settings);