Skip to content

Commit df21662

Browse files
committed
Send /cleanup response to private user chat instead of current chat.
1 parent 499c74c commit df21662

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Commands/AdminCommands/CleanupCommand.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,20 +351,14 @@ public function executeNoDb()
351351
public function execute()
352352
{
353353
$message = $this->getMessage();
354-
$chat_id = $message->getChat()->getId();
354+
$user_id = $message->getFrom()->getId();
355355
$text = $message->getText(true);
356356

357357
$data = [
358-
'chat_id' => $chat_id,
358+
'chat_id' => $user_id,
359359
'parse_mode' => 'Markdown',
360360
];
361361

362-
if (!$message->getChat()->isPrivateChat()) {
363-
$data['text'] = '/cleanup command is only available in a private chat.';
364-
365-
return Request::sendMessage($data);
366-
}
367-
368362
$settings = $this->getSettings($text);
369363
$queries = $this->getQueries($settings);
370364

0 commit comments

Comments
 (0)