diff --git a/apps/bridge-whatsapp/src/service.ts b/apps/bridge-whatsapp/src/service.ts index 9019eef..41450cc 100644 --- a/apps/bridge-whatsapp/src/service.ts +++ b/apps/bridge-whatsapp/src/service.ts @@ -343,7 +343,10 @@ export default class WhatsappService extends Service { attachments?: Array<{ data: string; filename: string; mime_type: string }>, ): Promise { const connection = this.connections[botID]?.socket; - const recipient = `${phoneNumber.replace(/\D+/g, "")}@s.whatsapp.net`; + const digits = phoneNumber.replace(/\D+/g, ""); + // LIDs are 15+ digits, phone numbers with country code are typically 10-14 digits + const suffix = digits.length > 14 ? "@lid" : "@s.whatsapp.net"; + const recipient = `${digits}${suffix}`; // Send text message if provided if (message) {