diff options
| author | levlam <levlam@telegram.org> | 2026-07-03 11:00:27 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2026-07-03 11:00:27 +0300 |
| commit | 075eabd2fa0d033b5e163bcd0716c7f3a315b1e0 (patch) | |
| tree | edf27c41070f4d7a0551a4fe3da1c646d1a13a8c | |
| parent | 1446635ecb5c3084cfcc7a34425221177cfb3221 (diff) | |
Support ephemeral bot commands.
| -rw-r--r-- | telegram-bot-api/Client.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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<td_api::object_ptr<td_api::botCommand>> 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<td_api::botCommand>(command, description, false); + return make_object<td_api::botCommand>(command, description, is_ephemeral); } td::Result<td::vector<td_api::object_ptr<td_api::botCommand>>> Client::get_bot_commands(const Query *query) { |
