DSDSDS
This commit is contained in:
parent
1bc18fbbaf
commit
758cba09b6
6
index.js
6
index.js
@ -73,13 +73,12 @@ app.post('/sendButtons', async (req, res) => {
|
|||||||
|
|
||||||
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
|
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
|
||||||
|
|
||||||
|
|
||||||
const BASE_URL = process.env.BASE_URL || 'https://wa.canguidev.fr';
|
const BASE_URL = process.env.BASE_URL || 'https://wa.canguidev.fr';
|
||||||
const imageUrl = `${BASE_URL}/static/logo-merlo-cs-FR.jpg`;
|
const imageUrl = `${BASE_URL}/static/logo-merlo-cs-FR.jpg`;
|
||||||
const jid = `${phone}@s.whatsapp.net`;
|
const jid = `${phone}@s.whatsapp.net`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await client.sendMessage(
|
await sock.sendMessage(
|
||||||
jid,
|
jid,
|
||||||
{
|
{
|
||||||
image: { url: imageUrl },
|
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
|
// Votre route POST
|
||||||
app.post('/sendInteractiveImage', async (req, res) => {
|
app.post('/sendInteractiveImage', async (req, res) => {
|
||||||
const { phone, caption, title, subtitle, footer } = req.body;
|
const { phone, caption, title, subtitle, footer } = req.body;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user