https://github.com/ditsuke/wa-member-migrate
Unpackaged set of functions I used in the process of migrating a WhatsApp group
https://github.com/ditsuke/wa-member-migrate
Last synced: 12 months ago
JSON representation
Unpackaged set of functions I used in the process of migrating a WhatsApp group
- Host: GitHub
- URL: https://github.com/ditsuke/wa-member-migrate
- Owner: ditsuke
- License: mit
- Created: 2022-11-05T07:18:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-09T15:37:56.000Z (about 3 years ago)
- Last Synced: 2025-02-21T18:15:19.941Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wa-member-migrate
A simple JavaScript program to migrate members from one WhatsApp group to another using the [wa-automate](https://github.com/open-wa/wa-automate-nodejs) library.
## Installation
To use this program, you need to have Node.js installed on your computer. Clone or download this repository and navigate to the directory in your terminal. Run the following command to install the required dependencies:
```
yarn install
```
## Usage
The `migrateMembers` function in `main.js` can be used to migrate members from one group to another. You need to provide the `sourceGroupId` and `targetGroupId` as parameters to this function. For example:
```javascript
const client = await initClient();
const sourceGroupId = '1234567890@g.us'; // replace with your source group ID
const targetGroupId = '0987654321@g.us'; // replace with your target group ID
await migrateMembers(client, sourceGroupId, targetGroupId);
```
To identify the group IDs of your WhatsApp groups, you can use the `printMatchingGroups` function. This function takes a `keyword` parameter and prints the names and IDs of all groups whose names match the keyword. For example:
```javascript
const client = await initClient();
await printMatchingGroups(client, 'ALiAS'); // replace ALiAS with your keyword
```
This will print the names and IDs of all groups whose names contain the word "family".
Note that this program adds members to the target group in batches of 10 with a 5-second delay between batches to avoid being blocked by WhatsApp. If any errors occur while adding members, they will be logged to the console.
## License
This project is licensed under the MIT License. See the `LICENSE` file for details.