Extract images sent from all the users in a Whatsapp group
- Clone this repository
git clone https://github.com/hanzala-sohrab/whatsapp-image-extractor.git
- Change directory
cd whatsapp-image-extractor
- Upgrade
node
version usingnvm
Ifnvm install 14.15
nvm
is not already installed, visit https://github.com/nvm-sh/nvm#installing-and-updating - Install
npm install
- Install TypeScript
npm install -g typescript
- For fetching the image uploaded by a user in a group, update line
23
with your chatId of choice in client.tsawait client.sendImage( "919XXXXXXXXX@c.us", imageBase64, filename, `You just received this ${message.type} from *${message.sender.name}* with id ${message.sender.id}, at ${message.timestamp}, in group *${message.chat.formattedTitle}* (id: ${message.chat.id})` );
- For fetching the image uploaded by a user in a group, update line
37
with a valid URL in client.ts where the request must be sentpost("Enter URL here", ...
- For fetching the details of a user who recently joined a group, update line
59
with your chatId of choice in client.tsawait client.sendText( "919XXXXXXXXX@c.us", `who: ${participantAdded.who}\nwhat: ${participantAdded.action}\ngroup: ${participantAdded.chat}` );
- For fetching the details of a user who recently joined a group, update line
63
with a valid URL in client.ts where the request must be sentpost("Enter URL here", ...
- Run the TypeScript file
tsc client.ts
- Run the JavaScript file
node client.js
- Scan the QR-Code with your phone using Whatsapp to create a new session