|
|
@ -21,11 +21,20 @@ export async function sendMessage(phone: string, message: string, mentions: stri
|
|
|
|
|
|
|
|
|
|
|
|
// Add mentions if provided
|
|
|
|
// Add mentions if provided
|
|
|
|
if (mentions.length > 0) {
|
|
|
|
if (mentions.length > 0) {
|
|
|
|
payload.options = {
|
|
|
|
payload = {
|
|
|
|
|
|
|
|
number: phone,
|
|
|
|
|
|
|
|
options: {
|
|
|
|
|
|
|
|
delay: 1200,
|
|
|
|
|
|
|
|
presence: 'composing',
|
|
|
|
|
|
|
|
linkPreview: false,
|
|
|
|
mentions: {
|
|
|
|
mentions: {
|
|
|
|
everyOne: false,
|
|
|
|
everyOne: false,
|
|
|
|
mentioned: mentions.map(phone => phone.split('@')[0]) // Strip @s.whatsapp.net
|
|
|
|
mentioned: mentions.map(phone => phone.split('@')[0]) // Strip @s.whatsapp.net
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
textMessage: {
|
|
|
|
|
|
|
|
text: message
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|