From 075eabd2fa0d033b5e163bcd0716c7f3a315b1e0 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 3 Jul 2026 11:00:27 +0300 Subject: Support ephemeral bot commands. --- 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 fe8277c..7c3ccc9 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -5613,6 +5613,9 @@ class Client::JsonBotCommand final : public td::Jsonable { auto object = scope->enter_object(); object("command", command_->command_); object("description", command_->description_); + if (command_->is_ephemeral_) { + object("is_ephemeral", td::JsonTrue()); + } } private: @@ -11236,8 +11239,9 @@ td::Result> Client::get_bot_command(td::J TRY_RESULT(command, object.get_required_string_field("command")); TRY_RESULT(description, object.get_required_string_field("description")); + TRY_RESULT(is_ephemeral, object.get_optional_bool_field("is_ephemeral")); - return make_object(command, description, false); + return make_object(command, description, is_ephemeral); } td::Result>> Client::get_bot_commands(const Query *query) { -- cgit v1.2.3