Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cancel group membership requests #2650

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

alechkos
Copy link
Collaborator

Table of Contents

- Description

- Usage Example

- I Want to Test this PR

- I Got an Error While Testing This PR ❌

- How Has the PR Been Tested (latest test on 24.11.2023)

- Types of Changes


Description

A small PR (the continuation of #2516) that adds a method to cancel a created group membership requests by the current user.

If some group has a Membership Approval Mode turned on, when trying to access that group by an invitation link, the group membership request is being created.
With this PR, it is possible to cancel that membership request.

The created group membership request looks like:


Usage Example

client.on('message', async (msg) => {
    if (msg.body === '!cancelMembershipRequest' && msg.author) {
        await client.cancelGroupMembershipRequest(msg.from);
    }
});

To test this PR by yourself you can run one of the following commands:

  • NPM
npm install github:alechkos/whatsapp-web.js#grp-memb-req-ext
  • YARN
yarn add github:alechkos/whatsapp-web.js#grp-memb-req-ext

If you encounter any errors while testing this PR, please provide in a comment:

  1. The code you've used without any sensitive information (use syntax highlighting for more readability)
  2. The error you got
  3. The library version
  4. The WWeb version: console.log(await client.getWWebVersion());
  5. The browser (Chrome/Chromium)

Important

You have to reapply the PR each time it is changed (new commits were pushed since your last application)


How Has The PR Been Tested (latest test on 24.11.2023)

Tested with a code provided in usage example.

Tested On:

Types of accounts:

  • Personal
  • Buisness

Environment:

  • Android 10:
    • WhatsApp v2.23.23.78
    • WA Business v2.23.23.78
  • Windows 10:
    • WWebJS 1.23.1-alpha.0
    • WWeb v2.2350.52
    • Puppeteer v18.2.1
    • Node v18.17.1
    • Chrome v119.0.6045.160

Types of Changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix/feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • I have updated the usage example accordingly (example.js)
  • I have updated the documentation accordingly (index.d.ts)

@alechkos alechkos marked this pull request as draft April 16, 2024 02:53
Repository owner locked and limited conversation to collaborators Apr 16, 2024
Repository owner unlocked this conversation Apr 19, 2024
@alechkos alechkos marked this pull request as ready for review April 27, 2024 19:32
@alechkos alechkos changed the title feat: method to cancel group membership requests feat: cancel group membership requests May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant