Answer the question
In order to leave comments, you need to log in
How to make a REST API wrapper over a library?
I found the whatsapp-web.js library , I wanted to make an internal service with the REST API. But the library code is written in an event style and all attempts were unsuccessful. For example, a qr-code request is executed automatically after calling initialize();
const client = new Client();
client.on('qr', (qr) => {
console.log('QR RECEIVED', qr);
});
client.initialize();
client.on('disconnected', (reason) => {
console.log('Client was logged out', reason);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question