This commit is contained in:
cangui 2025-05-06 21:18:49 +02:00
parent 1bc18fbbaf
commit 758cba09b6

View File

@ -73,13 +73,12 @@ app.post('/sendButtons', async (req, res) => {
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
const BASE_URL = process.env.BASE_URL || 'https://wa.canguidev.fr';
const imageUrl = `${BASE_URL}/static/logo-merlo-cs-FR.jpg`;
const jid = `${phone}@s.whatsapp.net`;
try {
await client.sendMessage(
await sock.sendMessage(
jid,
{
image: { url: imageUrl },
@ -113,7 +112,7 @@ app.post('/sendButtons', async (req, res) => {
]
},
{
quoted: null // tu peux remplacer `null` par un message existant si besoin
quoted: null // ou un message existant si tu veux répondre à un message
}
);
@ -124,6 +123,7 @@ app.post('/sendButtons', async (req, res) => {
}
});
// Votre route POST
app.post('/sendInteractiveImage', async (req, res) => {
const { phone, caption, title, subtitle, footer } = req.body;