Add separate method for revoking chat invite links.
This commit is contained in:
parent
840c1ba8f9
commit
936dbbb254
@ -4374,11 +4374,15 @@ createChatInviteLink chat_id:int53 expire_date:int32 member_limit:int32 is_perma
|
||||
|
||||
//@description Edits an invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat
|
||||
//@chat_id Chat identifier
|
||||
//@invite_link Invite link to be edited; must begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/"
|
||||
//@invite_link Invite link to be edited
|
||||
//@expire_date Point in time (Unix timestamp) when the link will expire; pass 0 if never
|
||||
//@member_limit Maximum number of chat members that can join the chat by the link simultaneously; 0-100000; pass 0 if not limited
|
||||
//@is_revoked True, if the link is revoked
|
||||
editChatInviteLink chat_id:int53 invite_link:string expire_date:int32 member_limit:int32 is_revoked:Bool = ChatInviteLink;
|
||||
editChatInviteLink chat_id:int53 invite_link:string expire_date:int32 member_limit:int32 = ChatInviteLink;
|
||||
|
||||
//@description Edits an invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat
|
||||
//@chat_id Chat identifier
|
||||
//@invite_link Invite link to be edited
|
||||
revokeChatInviteLink chat_id:int53 invite_link:string = ChatInviteLink;
|
||||
|
||||
//@description Returns exported invite links for a chat. Requires administrator privileges and can_invite_users right in the chat @chat_id Chat identifier @administrator_user_id If not 0, only invite links created by the specified administrator will be returned
|
||||
//@is_revoked Pass true if revoked links needs to be returned instead of active or expired
|
||||
|
Binary file not shown.
@ -1609,13 +1609,8 @@ class EditChatInviteLinkQuery : public Td::ResultHandler {
|
||||
return on_error(0, Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
|
||||
int32 flags = 0;
|
||||
if (expire_date > 0) {
|
||||
flags |= telegram_api::messages_editExportedChatInvite::EXPIRE_DATE_MASK;
|
||||
}
|
||||
if (usage_limit > 0) {
|
||||
flags |= telegram_api::messages_editExportedChatInvite::USAGE_LIMIT_MASK;
|
||||
}
|
||||
int32 flags = telegram_api::messages_editExportedChatInvite::EXPIRE_DATE_MASK |
|
||||
telegram_api::messages_editExportedChatInvite::USAGE_LIMIT_MASK;
|
||||
if (is_revoked) {
|
||||
flags |= telegram_api::messages_editExportedChatInvite::REVOKED_MASK;
|
||||
}
|
||||
|
@ -6285,7 +6285,14 @@ void Td::on_request(uint64 id, td_api::editChatInviteLink &request) {
|
||||
CREATE_REQUEST_PROMISE();
|
||||
CLEAN_INPUT_STRING(request.invite_link_);
|
||||
contacts_manager_->edit_dialog_invite_link(DialogId(request.chat_id_), request.invite_link_, request.expire_date_,
|
||||
request.member_limit_, request.is_revoked_, std::move(promise));
|
||||
request.member_limit_, false, std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::revokeChatInviteLink &request) {
|
||||
CREATE_REQUEST_PROMISE();
|
||||
CLEAN_INPUT_STRING(request.invite_link_);
|
||||
contacts_manager_->edit_dialog_invite_link(DialogId(request.chat_id_), request.invite_link_, 0, 0, true,
|
||||
std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::getChatInviteLinks &request) {
|
||||
|
@ -790,6 +790,8 @@ class Td final : public NetQueryCallback {
|
||||
|
||||
void on_request(uint64 id, td_api::editChatInviteLink &request);
|
||||
|
||||
void on_request(uint64 id, td_api::revokeChatInviteLink &request);
|
||||
|
||||
void on_request(uint64 id, td_api::getChatInviteLinks &request);
|
||||
|
||||
void on_request(uint64 id, td_api::getChatInviteLinkMembers &request);
|
||||
|
@ -2697,10 +2697,14 @@ class CliClient final : public Actor {
|
||||
string invite_link;
|
||||
int32 expire_date;
|
||||
int32 member_limit;
|
||||
bool is_revoked;
|
||||
get_args(args, chat_id, invite_link, expire_date, member_limit, is_revoked);
|
||||
send_request(td_api::make_object<td_api::editChatInviteLink>(as_chat_id(chat_id), invite_link, expire_date,
|
||||
member_limit, is_revoked));
|
||||
get_args(args, chat_id, invite_link, expire_date, member_limit);
|
||||
send_request(
|
||||
td_api::make_object<td_api::editChatInviteLink>(as_chat_id(chat_id), invite_link, expire_date, member_limit));
|
||||
} else if (op == "rcil") {
|
||||
string chat_id;
|
||||
string invite_link;
|
||||
get_args(args, chat_id, invite_link);
|
||||
send_request(td_api::make_object<td_api::revokeChatInviteLink>(as_chat_id(chat_id), invite_link));
|
||||
} else if (op == "gcil" || op == "gcilr") {
|
||||
string chat_id;
|
||||
string administrator_user_id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user