Add method editChatSubscriptionInviteLink.

This commit is contained in:
levlam 2024-08-14 00:29:32 +03:00
parent 76e5ed31c0
commit 961a19e1a0
2 changed files with 15 additions and 0 deletions

View File

@ -260,6 +260,7 @@ bool Client::init_methods() {
methods_.emplace("createchatinvitelink", &Client::process_create_chat_invite_link_query); methods_.emplace("createchatinvitelink", &Client::process_create_chat_invite_link_query);
methods_.emplace("createchatsubscriptioninvitelink", &Client::process_create_chat_subscription_invite_link_query); methods_.emplace("createchatsubscriptioninvitelink", &Client::process_create_chat_subscription_invite_link_query);
methods_.emplace("editchatinvitelink", &Client::process_edit_chat_invite_link_query); methods_.emplace("editchatinvitelink", &Client::process_edit_chat_invite_link_query);
methods_.emplace("editchatsubscriptioninvitelink", &Client::process_edit_chat_subscription_invite_link_query);
methods_.emplace("revokechatinvitelink", &Client::process_revoke_chat_invite_link_query); methods_.emplace("revokechatinvitelink", &Client::process_revoke_chat_invite_link_query);
methods_.emplace("getbusinessconnection", &Client::process_get_business_connection_query); methods_.emplace("getbusinessconnection", &Client::process_get_business_connection_query);
methods_.emplace("getchat", &Client::process_get_chat_query); methods_.emplace("getchat", &Client::process_get_chat_query);
@ -11236,6 +11237,19 @@ td::Status Client::process_edit_chat_invite_link_query(PromisedQueryPtr &query)
return td::Status::OK(); return td::Status::OK();
} }
td::Status Client::process_edit_chat_subscription_invite_link_query(PromisedQueryPtr &query) {
auto chat_id = query->arg("chat_id");
auto invite_link = query->arg("invite_link");
auto name = query->arg("name");
check_chat(chat_id, AccessRights::Write, std::move(query),
[this, invite_link = invite_link.str(), name = name.str()](int64 chat_id, PromisedQueryPtr query) {
send_request(make_object<td_api::editChatSubscriptionInviteLink>(chat_id, invite_link, name),
td::make_unique<TdOnGetChatInviteLinkCallback>(this, std::move(query)));
});
return td::Status::OK();
}
td::Status Client::process_revoke_chat_invite_link_query(PromisedQueryPtr &query) { td::Status Client::process_revoke_chat_invite_link_query(PromisedQueryPtr &query) {
auto chat_id = query->arg("chat_id"); auto chat_id = query->arg("chat_id");
auto invite_link = query->arg("invite_link"); auto invite_link = query->arg("invite_link");

View File

@ -685,6 +685,7 @@ class Client final : public WebhookActor::Callback {
td::Status process_create_chat_invite_link_query(PromisedQueryPtr &query); td::Status process_create_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_create_chat_subscription_invite_link_query(PromisedQueryPtr &query); td::Status process_create_chat_subscription_invite_link_query(PromisedQueryPtr &query);
td::Status process_edit_chat_invite_link_query(PromisedQueryPtr &query); td::Status process_edit_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_edit_chat_subscription_invite_link_query(PromisedQueryPtr &query);
td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query); td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_get_business_connection_query(PromisedQueryPtr &query); td::Status process_get_business_connection_query(PromisedQueryPtr &query);
td::Status process_get_chat_query(PromisedQueryPtr &query); td::Status process_get_chat_query(PromisedQueryPtr &query);