From 70428fb762621ec9d3f4f9961104ca7666389d93 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 18 Jan 2023 22:44:47 +0300 Subject: [PATCH] Improve BotInfo for bots with invalid tokens. --- telegram-bot-api/Client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 66b5dee..e68e23d 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -4103,7 +4103,11 @@ ServerBotInfo Client::get_bot_info() const { if (user_info != nullptr) { res.username_ = user_info->editable_username; } else if (!was_authorized_) { - res.username_ = ""; + if (logging_out_) { + res.username_ = ""; + } else { + res.username_ = ""; + } } else { res.username_ = ""; }