// Send direct test message to obaid via WAHA async function sendDirectMessage() { console.log('๐Ÿ“ฑ SENDING DIRECT MESSAGE TO OBAID'); console.log('='.repeat(40)); try { const testMessage = { session: 'default', chatId: '+201066544750@c.us', text: `๐Ÿงช DIRECT TEST MESSAGE FOR OBAID Hi Obaid! This is a direct test message from Clinera to confirm the WhatsApp integration is working perfectly. โœ… Reminder system: OPERATIONAL โœ… WAHA connection: WORKING โœ… Message delivery: IMMEDIATE Your appointment reminder system is now fully functional! ๐ŸŽ‰ Time sent: ${new Date().toLocaleString()}` }; console.log('๐Ÿ“ค Sending direct message via WAHA...'); const response = await fetch('http://localhost:3005/api/sendText', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Api-Key': '992659f827564646ba3ab95ead50adc9' }, body: JSON.stringify(testMessage) }); if (response.ok) { const result = await response.json(); console.log('โœ… DIRECT MESSAGE SENT SUCCESSFULLY!'); console.log('๐Ÿ“ฑ Message details:'); console.log(` ID: ${result.key?.id}`); console.log(` Status: ${result.status}`); console.log(` Timestamp: ${result.messageTimestamp}`); console.log('\n๐ŸŽฏ OBAID SHOULD RECEIVE BOTH MESSAGES:'); console.log(' 1. โœ… Booking confirmation (via Clinera system)'); console.log(' 2. โœ… Direct test message (via WAHA API)'); console.log('\n๐Ÿ“ฒ CHECK YOUR WHATSAPP NOW OBAID! ๐Ÿ“ฒ'); } else { console.log('โŒ Direct message failed:', response.status, await response.text()); } } catch (error) { console.error('โŒ Direct message error:', error); } } sendDirectMessage().catch(console.error);