From 4905a851f040af3ec058e3de03be52ed84c8fc2e Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 13 Apr 2020 14:18:46 +0300 Subject: [PATCH] Add clear_draft parameter to inputMessageDice. GitOrigin-RevId: 2ff67cf4fe198241f7713103f46d7d724d51e591 --- td/generate/scheme/td_api.tl | 4 ++-- td/generate/scheme/td_api.tlo | Bin 170896 -> 170932 bytes td/telegram/MessageContent.cpp | 5 ++++- td/telegram/cli.cpp | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 196fd493..c7958bc1 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1584,8 +1584,8 @@ inputMessageVenue venue:venue = InputMessageContent; //@description A message containing a user contact @contact Contact to send inputMessageContact contact:contact = InputMessageContent; -//@description A dice message -inputMessageDice = InputMessageContent; +//@description A dice message @clear_draft True, if a chat message draft should be deleted +inputMessageDice clear_draft:Bool = InputMessageContent; //@description A message with a game; not supported for channels or secret chats @bot_user_id User identifier of the bot that owns the game @game_short_name Short name of the game inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 8672a88bb097bc5bbaf76e8e0c72ce88676bd12f..ba6ec2744e1e42dea1e40571ecffb9347730b675 100644 GIT binary patch delta 748 zcmbQRoomZ>t_=$WSt{M{a%^5Ac%}xzD(Rb`2xd**uv=lX#)cY31nN| zGh0lMcq-eLAo1R8*I`1KVza9NBDZAn{@j@E~}Tdk#u)f}DNx zn2-7e+m(1i;pgb%X87DIy(ubI{ z;55RIOp`Y@Xixs(qXUuBI0La_bHJGeP>+2%3l)+%Cj%9-IgjuU>-3MDjQZ0HjxnlE zK6t(yY)rGwh3z&M7;7XUh6a39*na0F;}j(@clw4Gj0)SQ@G#jxOq;II%cQvdD=(8b nGzo!}rwA|!AaQ31F{wb}fBJzurWX)%65^N?wx7voI-(5#L{u@R delta 743 zcmdn8oom8&t_=$WS=4VmXWzU;@JtPaRnj*>5zLyrVYk9&jSV%72;PZ}Gmv;Kn^ll_ zXSSFi@l>`gLE^pHuET^d#b#FlL~iqj-62S-H1--G@oM(%LE^<6;6d;v_Z*Y}8#n#J zL`I#-R}RKN3^zHX0bwK@x&vW299H23`S0d2As@EMjZ4HQ-#8&KdCK8E5b2O3Pz?=7 zDj*_%jvzF!PZz9aQl6}^j%9Md(H9VTn_~!hmdSy4)F)3kmI2j@B*i)T;}7x84#z#9 zj_x@DwP?qQIS|zmCpF+MW0~$4!zc}Q8qZ0U={ye^RVM2kQGqB_IR(`ka4G^KvgQ=R z4UCfyE>fQS=M)D-isLj?m%(WR2av}Zpx~+;SIiT`C%*+U^9o8!d{c{y6Vp>&GLut* z@~{8`DJ^nl)8VjfI|ve+d<16No72z`_Bn&FntS?QXGZnS3(k~4Jt=VxV)0$oAZceh jP_e@H4gn?sWd0r@CKZU|!1B{s@|jLR%)XG%^h6r~GuS+X diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 04f6d03b..bb53c27a 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -1475,9 +1475,12 @@ static Result create_input_message_content( content = make_unique(file_id, std::move(caption)); break; } - case td_api::inputMessageDice::ID: + case td_api::inputMessageDice::ID: { + auto input_dice = static_cast(input_message_content.get()); content = make_unique(); + clear_draft = input_dice->clear_draft_; break; + } case td_api::inputMessageDocument::ID: td->documents_manager_->create_document(file_id, string(), thumbnail, std::move(file_name), std::move(mime_type), false); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index a31a79ad..453954cf 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3123,8 +3123,8 @@ class CliClient final : public Actor { send_message(chat_id, td_api::make_object(as_chat_id(from_chat_id), as_message_id(from_message_id), true, op == "scopy", Random::fast(0, 1) == 0)); - } else if (op == "sdice") { - send_message(args, td_api::make_object()); + } else if (op == "sdice" || op == "sdicecd") { + send_message(args, td_api::make_object(op == "sdicecd")); } else if (op == "sd") { string chat_id; string document_path;