whatsapp-api-js
Advanced tools
Comparing version 0.7.0 to 0.7.1-alpha.0
15
fetch.js
@@ -8,3 +8,4 @@ const { Contacts } = require('./types/contacts'); | ||
const req = require('./fetch-picker').pick(); | ||
const fetch = require('cross-fetch'); | ||
// const fetch = require('./fetch-picker').pick(); | ||
@@ -80,3 +81,3 @@ /** | ||
// Make the post request | ||
const promise = req(`https://graph.facebook.com/${v}/${phoneID}/messages`, { | ||
const promise = fetch(`https://graph.facebook.com/${v}/${phoneID}/messages`, { | ||
method: "POST", | ||
@@ -105,3 +106,3 @@ headers: { | ||
function readMessage(token, v, phoneID, message_id) { | ||
return req(`https://graph.facebook.com/${v}/${phoneID}/messages`, { | ||
return fetch(`https://graph.facebook.com/${v}/${phoneID}/messages`, { | ||
method: "POST", | ||
@@ -138,3 +139,3 @@ headers: { | ||
return req(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls?${new URLSearchParams(params)}`, { | ||
return fetch(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls?${new URLSearchParams(params)}`, { | ||
method: "POST", | ||
@@ -159,3 +160,3 @@ headers: { | ||
function getQR(token, v, phoneID, id) { | ||
return req(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id ?? ""}`, { | ||
return fetch(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id ?? ""}`, { | ||
headers: { | ||
@@ -184,3 +185,3 @@ 'Authorization': `Bearer ${token}`, | ||
return req(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id}?${new URLSearchParams(params)}`, { | ||
return fetch(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id}?${new URLSearchParams(params)}`, { | ||
method: "POST", | ||
@@ -205,3 +206,3 @@ headers: { | ||
function deleteQR(token, v, phoneID, id) { | ||
return req(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id}`, { | ||
return fetch(`https://graph.facebook.com/${v}/${phoneID}/message_qrdls/${id}`, { | ||
method: "DELETE", | ||
@@ -208,0 +209,0 @@ headers: { |
{ | ||
"name": "whatsapp-api-js", | ||
"version": "0.7.0", | ||
"version": "0.7.1-alpha.0", | ||
"author": "Secreto31126", | ||
@@ -5,0 +5,0 @@ "description": "A Whatsapp Official API framework for Node.js", |
105930
15
2282
6