node-whatsapp-bot-api
Advanced tools
Comparing version 1.4.5 to 1.4.6
@@ -120,2 +120,3 @@ "use strict"; | ||
* @param to The recipient of the message. | ||
* @returns wam_id The whatsapp message id of the sent message. | ||
*/ | ||
@@ -143,4 +144,8 @@ sendTextMessage(textMessage, to) { | ||
try { | ||
yield (0, makePostRequest_1.default)(this, axiosConfig); | ||
const response = yield (0, makePostRequest_1.default)(this, axiosConfig); | ||
const data = response.data; | ||
this.logger.verbose(`Successfully sent message to: ${to}.`); | ||
// Should return back the wam_id from the sent whatsapp message. | ||
// Because status code of 200 was returned before in the checks we can assume that response will be correct. | ||
return data.messages[0]["id"]; | ||
} | ||
@@ -147,0 +152,0 @@ catch (error) { |
@@ -509,4 +509,5 @@ // Generated by dts-bundle-generator v8.0.1 | ||
* @param to The recipient of the message. | ||
* @returns wam_id The whatsapp message id of the sent message. | ||
*/ | ||
sendTextMessage(textMessage: string, to: string): Promise<void>; | ||
sendTextMessage(textMessage: string, to: string): Promise<string | undefined>; | ||
} | ||
@@ -513,0 +514,0 @@ |
{ | ||
"name": "node-whatsapp-bot-api", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "WhatsApp Bot that can be used as middleware to emit events to listeners. Listeners can react to incoming messages. Additionally, the WhatsApp bot can send messages if a WhatsApp Cloud API token is provided.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58263
25
1255