diff --git a/langs/en.json b/langs/en.json index 969c05ab7..7b6b778cd 100644 --- a/langs/en.json +++ b/langs/en.json @@ -148,5 +148,7 @@ "invalid_dl.php_session": "%s is not a valid download script because its session ID is different (expected %s, got %s)", "need_dl.php": "Could not generate default download script (%s), please create a dl.php file with the following content: %s and pass its URL to the second parameter of getDownloadLink", - "dl.php_powered_by_madelineproto": "Telegram file download server (up to 4GB), powered by MadelineProto!
Click here for more info on how to setup your very own Telegram file download server!" + "dl.php_powered_by_madelineproto": "Telegram file download server (up to 4GB), powered by MadelineProto!
Click here for more info on how to setup your very own Telegram file download server!", + + "account_banned": "!!!!!!! WARNING !!!!!!!\nTelegram's flood prevention system suspended this account.\nTo continue, manual verification is required.\nSend an email to recover@telegram.org, asking to unban the phone number %s, and shortly describe what will you do with this phone number.\nThen login again.\nIf you intentionally deleted this account, ignore this message." } diff --git a/src/MTProtoSession/ResponseHandler.php b/src/MTProtoSession/ResponseHandler.php index 947acb197..684392a29 100644 --- a/src/MTProtoSession/ResponseHandler.php +++ b/src/MTProtoSession/ResponseHandler.php @@ -20,6 +20,7 @@ declare(strict_types=1); namespace danog\MadelineProto\MTProtoSession; +use danog\MadelineProto\Lang; use danog\MadelineProto\Logger; use danog\MadelineProto\Loop\Update\UpdateLoop; use danog\MadelineProto\MTProto; @@ -322,13 +323,8 @@ trait ResponseHandler case 'SESSION_EXPIRED': $this->logger->logger($response['error_message'], Logger::FATAL_ERROR); if (\in_array($response['error_message'], ['USER_DEACTIVATED', 'USER_DEACTIVATED_BAN'], true)) { - $this->logger->logger('!!!!!!! WARNING !!!!!!!', Logger::FATAL_ERROR); - $this->logger->logger("Telegram's flood prevention system suspended this account.", Logger::ERROR); - $this->logger->logger('To continue, manual verification is required.', Logger::FATAL_ERROR); - $phone = isset($this->API->authorization['user']['phone']) ? '+' . $this->API->authorization['user']['phone'] : 'you are currently using'; - $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number ' . $phone . ', and shortly describe what will you do with this phone number.', Logger::FATAL_ERROR); - $this->logger->logger('Then login again.', Logger::FATAL_ERROR); - $this->logger->logger('If you intentionally deleted this account, ignore this message.', Logger::FATAL_ERROR); + $phone = isset($this->API->authorization['user']['phone']) ? '+' . $this->API->authorization['user']['phone'] : '???'; + $this->logger->logger(sprintf(Lang::$current_lang['account_banned'], $phone), Logger::FATAL_ERROR); } return fn () => new RPCErrorException($response['error_message'], $response['error_code'], $request->getConstructor()); case 'AUTH_KEY_UNREGISTERED': @@ -347,13 +343,8 @@ trait ResponseHandler $this->logger->logger("Auth key not registered in DC {$this->datacenter} with RPC error {$response['error_message']}, resetting temporary and permanent auth keys...", Logger::ERROR); if ($this->API->authorized_dc == $this->datacenter && $this->API->authorized === \danog\MadelineProto\API::LOGGED_IN) { $this->logger->logger('Permanent auth key was main authorized key, logging out...', Logger::FATAL_ERROR); - $this->logger->logger('!!!!!!! WARNING !!!!!!!', Logger::FATAL_ERROR); - $this->logger->logger("Telegram's flood prevention system suspended this account.", Logger::ERROR); - $this->logger->logger('To continue, manual verification is required.', Logger::FATAL_ERROR); $phone = isset($this->API->authorization['user']['phone']) ? '+' . $this->API->authorization['user']['phone'] : 'you are currently using'; - $this->logger->logger('Send an email to recover@telegram.org, asking to unban the phone number ' . $phone . ', and quickly describe what will you do with this phone number.', Logger::FATAL_ERROR); - $this->logger->logger('Then login again.', Logger::FATAL_ERROR); - $this->logger->logger('If you intentionally deleted this account, ignore this message.', Logger::FATAL_ERROR); + $this->logger->logger(sprintf(Lang::$current_lang['account_banned'], $phone), Logger::FATAL_ERROR); return fn () => new RPCErrorException($response['error_message'], $response['error_code'], $request->getConstructor()); } EventLoop::queue(function () use ($request): void {