From f95132c5bd262472ec32fcee1473d7e16e12da7c Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 15 May 2024 13:57:33 +0300 Subject: [PATCH] Ignore INPUT_TEXT_EMPTY errors for translateText. --- td/telegram/TranslationManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/td/telegram/TranslationManager.cpp b/td/telegram/TranslationManager.cpp index 1b5b2c303..250de4afd 100644 --- a/td/telegram/TranslationManager.cpp +++ b/td/telegram/TranslationManager.cpp @@ -47,6 +47,11 @@ class TranslateTextQuery final : public Td::ResultHandler { } void on_error(Status status) final { + if (status.message() == "INPUT_TEXT_EMPTY") { + vector> result; + result.push_back(telegram_api::make_object(string(), Auto())); + return promise_.set_value(std::move(result)); + } promise_.set_error(std::move(status)); } };