diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 1ddf5fb..b43a9db 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -5687,7 +5687,8 @@ class Client::TdOnDeleteFailedToSendMessageCallback final : public TdQueryCallba void on_result(object_ptr result) final { if (result->get_id() == td_api::error::ID) { auto error = move_object_as(result); - if (error->code_ != 401 && !client_->need_close_ && !client_->closing_ && !client_->logging_out_) { + if (error->code_ != 401 && !client_->need_close_ && !client_->closing_ && !client_->logging_out_ && + client_->have_message_access(chat_id_)) { LOG(ERROR) << "Can't delete failed to send message " << message_id_ << " because of " << td::oneline(to_string(error)) << " in " << client_->get_chat_description(chat_id_) << ". Old chat description: " << old_chat_description_;