ddd
This commit is contained in:
parent
799102c9f1
commit
2b07bfd426
24
index.js
24
index.js
@ -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'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user