@andrey4emk/npm-app-back-b24 0.6.6 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sendMessage/wappi.js +3 -2
package/package.json
CHANGED
package/sendMessage/wappi.js
CHANGED
|
@@ -116,6 +116,7 @@ export class Wappi {
|
|
|
116
116
|
if (fileName.includes(".pdf")) {
|
|
117
117
|
await this.sendMessageWappi(messangerType, { phone: phone, message: message });
|
|
118
118
|
}
|
|
119
|
+
console.log("base64:", base64);
|
|
119
120
|
let res = await fetch(url, {
|
|
120
121
|
method: "POST",
|
|
121
122
|
headers: {
|
|
@@ -125,7 +126,7 @@ export class Wappi {
|
|
|
125
126
|
|
|
126
127
|
body: JSON.stringify({
|
|
127
128
|
recipient: phone,
|
|
128
|
-
|
|
129
|
+
// ! url: fileUrl,
|
|
129
130
|
file_name: fileName,
|
|
130
131
|
caption: message,
|
|
131
132
|
base64: base64,
|
|
@@ -281,7 +282,7 @@ export class Wappi {
|
|
|
281
282
|
const buffer = Buffer.from(arrayBuffer);
|
|
282
283
|
|
|
283
284
|
const base64String = buffer.toString("base64");
|
|
284
|
-
return { error: false,
|
|
285
|
+
return { error: false, data: base64String };
|
|
285
286
|
} catch (error) {
|
|
286
287
|
return { error: true, message: `Ошибка при скачивании и конвертировании в base64 файла по fileUrl: ${error.message}` };
|
|
287
288
|
}
|