This commit is contained in:
julien 2025-05-06 13:52:08 +02:00
parent 799102c9f1
commit 2b07bfd426

View File

@ -122,15 +122,21 @@ app.post('/sendText', async (req, res) => {
});
app.post('/sendButtons', async (req, res) => {
const { phone } = req.body;
if (!sock || !isConnected) return res.status(400).json({ error: 'Non connecté' });
try {
await sendInteractive(sock, `${phone}@s.whatsapp.net`, 'https://placekitten.com/300/200');
res.json({ success: true });
} catch (e) {
console.error(e);
res.status(500).json({ error: e.message });
}
sock.sendMessage(jid, {
text: "Hello World !",
footer: "Fizzxy - 2025",
buttons: [
{
buttonId: `🚀`,
buttonText: {
displayText: '🗿'
},
type: 1
}
],
headerType: 1,
viewOnce: true
},{ quoted: null })
});
app.listen(3001, () => console.log('🚀 Serveur Baileys démarré sur http://localhost:3001'));