diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 44a3a086..5e7a7530 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3503,6 +3503,9 @@ setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok; //@description Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use @chat_id Chat identifier @location New location for the chat; must be valid and not null setChatLocation chat_id:int53 location:chatLocation = Ok; +//@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600 +setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; + //@description Pins a message in a chat; requires can_pin_messages rights @chat_id Identifier of the chat @message_id Identifier of the new pinned message @disable_notification True, if there should be no notification about the pinned message pinChatMessage chat_id:int53 message_id:int53 disable_notification:Bool = Ok; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 687b597f..17df016e 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 8bc893fe..94ffa486 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6069,6 +6069,13 @@ void Td::on_request(uint64 id, td_api::setChatLocation &request) { std::move(promise)); } +void Td::on_request(uint64 id, const td_api::setChatSlowModeDelay &request) { + CHECK_IS_USER(); + CREATE_OK_REQUEST_PROMISE(); + contacts_manager_->set_channel_slow_mode_delay(DialogId(request.chat_id_), request.slow_mode_delay_, + std::move(promise)); +} + void Td::on_request(uint64 id, const td_api::pinChatMessage &request) { CREATE_OK_REQUEST_PROMISE(); messages_manager_->pin_dialog_message(DialogId(request.chat_id_), MessageId(request.message_id_), diff --git a/td/telegram/Td.h b/td/telegram/Td.h index bf63d9e3..2949d409 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -676,6 +676,8 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::setChatLocation &request); + void on_request(uint64 id, const td_api::setChatSlowModeDelay &request); + void on_request(uint64 id, const td_api::pinChatMessage &request); void on_request(uint64 id, const td_api::unpinChatMessage &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 1c6844e2..1488fb8e 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3534,6 +3534,13 @@ class CliClient final : public Actor { std::tie(latitude, longitude) = split(args); send_request(td_api::make_object( as_chat_id(chat_id), td_api::make_object(as_location(latitude, longitude), "address"))); + } else if (op == "scsmd") { + string chat_id; + string slow_mode_delay; + + std::tie(chat_id, slow_mode_delay) = split(args); + send_request( + td_api::make_object(as_chat_id(chat_id), to_integer(slow_mode_delay))); } else if (op == "pcm" || op == "pcms") { string chat_id; string message_id;