Skip to content

Commit aa6b25a

Browse files
committed
Documentation improvement
1 parent 9bea6fa commit aa6b25a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const Text = require('./types/text');
88
const fetch = require('./fetch');
99

1010
/**
11-
* @typedef {Object} WhatsAppAPI The main API object
11+
* The main API object
12+
*
1213
* @property {String} token The API token
1314
* @property {String} v The API version to use
1415
*/

requests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function post(data, onMessage, onStatus) {
6666
const value = data.entry[0].changes[0].value;
6767
const phoneID = value.metadata.phone_number_id;
6868

69-
// Check if the message is a message
69+
// Check if the message is a message or a status update
7070
if (value.messages) {
7171
const contact = value.contacts[0];
7272

@@ -91,7 +91,7 @@ function post(data, onMessage, onStatus) {
9191

9292
return 200;
9393
} else {
94-
// Return a "404 Not Found" if event is not from a whatsApp API
94+
// Throw "400 Bad Request" if data is not a valid WhatsApp API request
9595
throw 400;
9696
}
9797
}

0 commit comments

Comments
 (0)