add send-message info

This commit is contained in:
Simone Gallo 2024-04-18 12:47:22 +02:00
parent fd65542389
commit 612b0f47af
1 changed files with 3 additions and 2 deletions

View File

@ -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');