From 79ea50766498dc949e676b9ffd7c7899f9885ecf Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 9 Mar 2023 18:54:59 +0300 Subject: [PATCH] Minor improvements. --- telegram-bot-api/Client.cpp | 2 +- telegram-bot-api/HttpServer.h | 3 ++- telegram-bot-api/WebhookActor.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 4519df5..75dd162 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -6839,7 +6839,7 @@ td::Result> Client::get_input_sticker(c TRY_RESULT(sticker, get_json_object_string_field(object, "sticker")); auto input_file = get_input_file(query, td::Slice(), sticker, false); if (input_file == nullptr) { - return td::Status::Error("sticker not found"); + return td::Status::Error(400, "sticker not found"); } TRY_RESULT(emoji_list, get_json_object_field(object, "emoji_list", td::JsonValue::Type::Array, false)); TRY_RESULT(emojis, get_sticker_emojis(std::move(emoji_list))); diff --git a/telegram-bot-api/HttpServer.h b/telegram-bot-api/HttpServer.h index 13a03c8..8686a3f 100644 --- a/telegram-bot-api/HttpServer.h +++ b/telegram-bot-api/HttpServer.h @@ -12,6 +12,7 @@ #include "td/actor/actor.h" #include "td/utils/BufferedFd.h" +#include "td/utils/common.h" #include "td/utils/FloodControlFast.h" #include "td/utils/format.h" #include "td/utils/logging.h" @@ -47,7 +48,7 @@ class HttpServer final : public td::TcpListener::Callback { return; } flood_control_.add_event(now); - LOG(INFO) << "Create tcp listener " << td::tag("address", ip_address_) << td::tag("port", port_); + LOG(INFO) << "Create TCP listener " << td::tag("address", ip_address_) << td::tag("port", port_); listener_ = td::create_actor( PSLICE() << "TcpListener" << td::tag("address", ip_address_) << td::tag("port", port_), port_, actor_shared(this, 1), ip_address_); diff --git a/telegram-bot-api/WebhookActor.cpp b/telegram-bot-api/WebhookActor.cpp index 91b4e69..9c67bb3 100644 --- a/telegram-bot-api/WebhookActor.cpp +++ b/telegram-bot-api/WebhookActor.cpp @@ -399,7 +399,7 @@ void WebhookActor::load_updates() { CHECK(update.id.is_valid()); auto &dest_ptr = update_map_[update.id]; if (dest_ptr != nullptr) { - LOG(ERROR) << "Receive duplicated event " << update.id << " from TQueue"; + LOG(ERROR) << "Receive duplicate event " << update.id << " from TQueue"; continue; } dest_ptr = td::make_unique();