From b1ea0e31da5512fb56cd4831f5528f789556d425 Mon Sep 17 00:00:00 2001 From: Ibnu syawal <46734417+ibnusyawall@users.noreply.github.com> Date: Sun, 28 Mar 2021 14:39:55 +0000 Subject: [PATCH] Added method to revokes link of group chat (#421) --- README.md | 5 +++++ src/WAConnection/8.Groups.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 4d8df35..d16aa19 100644 --- a/README.md +++ b/README.md @@ -527,6 +527,11 @@ Of course, replace ``` xyz ``` with an actual ID. console.log("joined to: " + response.gid) ``` Of course, replace ``` xxx ``` with invitation code. +- To revokes the current invite link of a group + ``` ts + const response = await conn.revokeInvite ("abcd-xyz@g.us") + console.log("new group code: " + response.code) + ``` ## Broadcast Lists & Stories diff --git a/src/WAConnection/8.Groups.ts b/src/WAConnection/8.Groups.ts index 05b7e28..aced983 100644 --- a/src/WAConnection/8.Groups.ts +++ b/src/WAConnection/8.Groups.ts @@ -182,4 +182,9 @@ export class WAConnection extends Base { const response = await this.query({ json: ['action', 'invite', jid], expect200: true }) return response } + /** Revokes the current invite link for a group chat */ + async revokeInvite(jid) { + const response = await this.query({ json: ['action', 'inviteReset', jid], expect200: true }) + return response + } }