I'm using whatsapp-web.js `client.on('message', m...
# 💻developers
g
I'm using whatsapp-web.js
Copy code
client.on('message', message => {

    console.log('number', message.from);
    if( message.from == '559295105867@c.us' ){
        const number = message.from.split('@')
        const from = number[0]
        axios({
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            data: {
                type: "text",
                text: message.body,
                from
            },
            url: "http://127.0.0.1:3000/api/v1/bots/bot-zdg/converse/552298120000"
        }).then(async res => {
        }).catch(e =>{
            console.log('error',e.response.data);
            console.log('error',e.message);
        })
    }
});
I want to send in payload data the
from
it is because I want set the customer number phone in variable to use after, How can I to do this?
7 Views