main
borja 3 months ago
parent 233f27aa59
commit 4daca04352

Binary file not shown.

@ -12,14 +12,15 @@ if (!API_URL || !INSTANCE_NAME || !API_KEY) {
}
// Send a message with optional mentions
export async function sendMessage(phone: string, message: string | {text: string}, mentions: string[] = []) {
export async function sendMessage(phone: string, message: string | { text: string }, mentions: string[] = []) {
try {
// Normalize message input to always have text property
const messageText = typeof message === 'string' ? message : message.text;
console.log(`el phone es ${phone} y el mensaje es ${message}`)
// Build payload according to API specification
const payload = {
number: phone,
text: messageText,
textMessage: {
text: messageText
},

Loading…
Cancel
Save