Skip to content

hanzala-sohrab/whatsapp-image-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whatsapp-image-extractor

Extract images sent from all the users in a Whatsapp group

Steps

  1. Clone this repository
    git clone https://github.com/hanzala-sohrab/whatsapp-image-extractor.git
  2. Change directory
    cd whatsapp-image-extractor
  3. Upgrade node version using nvm
    nvm install 14.15
    If nvm is not already installed, visit https://github.com/nvm-sh/nvm#installing-and-updating
  4. Install
    npm install
  5. Install TypeScript
    npm install -g typescript
  6. For fetching the image uploaded by a user in a group, update line 23 with your chatId of choice in client.ts
    await 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})`
    );
  7. 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 sent
    post("Enter URL here", ...
  8. For fetching the details of a user who recently joined a group, update line 59 with your chatId of choice in client.ts
    await client.sendText(
      "919XXXXXXXXX@c.us",
      `who: ${participantAdded.who}\nwhat: ${participantAdded.action}\ngroup: ${participantAdded.chat}`
    );
  9. 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 sent
    post("Enter URL here", ...
  10. Run the TypeScript file
    tsc client.ts
  11. Run the JavaScript file
    node client.js
  12. Scan the QR-Code with your phone using Whatsapp to create a new session