Send /cleanup response to private user chat instead of current chat.

parent ecb9e774
......@@ -351,20 +351,14 @@ class CleanupCommand extends AdminCommand
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);
......
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