@andrey4emk/npm-app-back-b24 0.4.3 → 0.4.5
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/chatApp.js +2 -2
- package/sendMessage/smsgold.js +9 -1
package/package.json
CHANGED
package/sendMessage/chatApp.js
CHANGED
|
@@ -176,10 +176,10 @@ class ChatApp {
|
|
|
176
176
|
}
|
|
177
177
|
let url;
|
|
178
178
|
if (messangerType === "whatsApp") {
|
|
179
|
-
url = `https://api.chatapp.online/v1/licenses/${config.chatApp.type.whatsApp.licenseId}/messengers/${config.chatApp.type.whatsApp.messenger[0].type}/
|
|
179
|
+
url = `https://api.chatapp.online/v1/licenses/${config.chatApp.type.whatsApp.licenseId}/messengers/${config.chatApp.type.whatsApp.messenger[0].type}/phones/${phone}/check`;
|
|
180
180
|
}
|
|
181
181
|
if (messangerType === "telegram") {
|
|
182
|
-
url = `https://api.chatapp.online/v1/licenses/${config.chatApp.type.telegram.licenseId}/messengers/${config.chatApp.type.telegram.messenger[0].type}/
|
|
182
|
+
url = `https://api.chatapp.online/v1/licenses/${config.chatApp.type.telegram.licenseId}/messengers/${config.chatApp.type.telegram.messenger[0].type}/phones/${phone}/check`;
|
|
183
183
|
}
|
|
184
184
|
let res = await fetch(url, {
|
|
185
185
|
method: "GET",
|
package/sendMessage/smsgold.js
CHANGED
|
@@ -9,7 +9,15 @@ class Smsgold {
|
|
|
9
9
|
this.pass = process.env.SMSGOLD_PASS;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
async sendSms(
|
|
12
|
+
async sendSms(messageData) {
|
|
13
|
+
const { phone, message } = messageData;
|
|
14
|
+
// Проверяем наличие необходимых данных
|
|
15
|
+
if (!this.user || !this.pass) {
|
|
16
|
+
return { error: true, message: "Отсутствуют учетные данные SMSGold", result: null };
|
|
17
|
+
}
|
|
18
|
+
if (!phone || !message) {
|
|
19
|
+
return { error: true, message: "Отсутствуют номер телефона или текст сообщения", result: null };
|
|
20
|
+
}
|
|
13
21
|
try {
|
|
14
22
|
let body = new URLSearchParams({
|
|
15
23
|
user: this.user,
|