diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index 854affb59..dd273f160 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -453,7 +453,8 @@ void AuthManager::tear_down() { } bool AuthManager::is_bot() const { - return is_authorized() && is_bot_; + return is_bot_ && (state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys || + state_ == State::Closing); } void AuthManager::set_is_bot(bool is_bot) {