add send-message info
This commit is contained in:
parent
fd65542389
commit
612b0f47af
5
main.js
5
main.js
|
@ -25,8 +25,6 @@ client.on('qr', qr => {
|
|||
// Listening to all incoming messages
|
||||
client.on('message_create', message => {
|
||||
console.log(message.body);
|
||||
// console.log(message)
|
||||
// sendMessage(message.from, 'Olá! Estou ocupado agora, mas assim que possível entrarei em contato.');
|
||||
});
|
||||
|
||||
function sendMessage(number, message) {
|
||||
|
@ -34,6 +32,9 @@ function sendMessage(number, message) {
|
|||
}
|
||||
|
||||
app.post('/send-message', (req, res) => {
|
||||
/*
|
||||
This function only accepts numbers formatted as: [CountryCode][Number]@c.us // Example: 39333555887@c.us
|
||||
*/
|
||||
const { number, message } = req.body;
|
||||
if (!number || !message) {
|
||||
return res.status(400).send('Number and message are required');
|
||||
|
|
Loading…
Reference in New Issue