AsYnC
This commit is contained in:
parent
c4cca8c929
commit
de148ab579
2
index.js
2
index.js
|
@ -59,6 +59,7 @@ app.post('/sms', async (req, res) => {
|
||||||
filename = data.MediaURLs[i].split("/").pop();
|
filename = data.MediaURLs[i].split("/").pop();
|
||||||
out['images'].push({ name: filename, attachment: data.MediaURLs[i] });
|
out['images'].push({ name: filename, attachment: data.MediaURLs[i] });
|
||||||
} else if (data.MediaURLs[i].includes(".3gp")) { // Weird file format, convert it to mp4
|
} else if (data.MediaURLs[i].includes(".3gp")) { // Weird file format, convert it to mp4
|
||||||
|
await (async () => {
|
||||||
// get file name from URL
|
// get file name from URL
|
||||||
filename = data.MediaURLs[i].split("/").pop();
|
filename = data.MediaURLs[i].split("/").pop();
|
||||||
// Download the file
|
// Download the file
|
||||||
|
@ -92,6 +93,7 @@ app.post('/sms', async (req, res) => {
|
||||||
console.log(e.code);
|
console.log(e.code);
|
||||||
console.log(e.msg);
|
console.log(e.msg);
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue