Skip to content

Commit

Permalink
Merge pull request #125 from HelioSilva/FixSendImages
Browse files Browse the repository at this point in the history
Fix Send Images #124
  • Loading branch information
vasani-arpit authored Mar 29, 2020
2 parents 74152e6 + 775405e commit 72a533c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wbot",
"version": "0.12.2",
"version": "0.12.3",
"description": "A simple whatsapp reply bot using puppeteer.",
"main": "src/index.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ WAPI.waitNewMessages(false, (data) => {
//replying to the user based on response
WAPI.sendMessage2(message.from._serialized, response[0].text);
//sending files if there is any
if(response.files){
if (response.files.length > 0) {
response.files.forEach((file) => {
WAPI.sendImage(file.file, response.From, file.name);
if(response[0].files){
if (response[0].files.length > 0) {
response[0].files.forEach((file) => {
WAPI.sendImage(file.file, message.from._serialized , file.name);
})
}
}
Expand Down

0 comments on commit 72a533c

Please sign in to comment.