Skip to content

Commit

Permalink
resolving #231
Browse files Browse the repository at this point in the history
  • Loading branch information
vasani-arpit committed Jun 19, 2021
1 parent 9f25952 commit ed9c3af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,18 @@ async function processMessages(data) {
WAPI.sendSeen(message.chatId._serialized);
response = response.fillVariables({ name: message.sender.pushname, phoneNumber: message.sender.id.user, greetings: greetings() })
await waitBeforeSending(exactMatch, PartialMatch)
WAPI.sendMessage2(message.chatId._serialized, response);
if (exactMatch != undefined || PartialMatch != undefined) {
//returning if there is no file
if ((exactMatch || PartialMatch).file != undefined) {
files = await resolveSpintax((exactMatch || PartialMatch).file);
window.getFile(files).then((base64Data) => {
//console.log(file);
WAPI.sendImage(base64Data, message.chatId._serialized, (exactMatch || PartialMatch).file);
WAPI.sendImage(base64Data, message.chatId._serialized, (exactMatch || PartialMatch).file, response);
}).catch((error) => {
window.log("Error in sending file\n" + error);
})
} else {
WAPI.sendMessage2(message.chatId._serialized, response);
}
}
//sending file if there is any
Expand Down

0 comments on commit ed9c3af

Please sign in to comment.