fix: update remoteJid handling to avoid unnecessary splitting for message number

This commit is contained in:
Vitordotpy
2025-11-28 16:18:33 -03:00
parent 13f96a366b
commit baff4e8f5e
4 changed files with 84 additions and 14 deletions

View File

@@ -1614,9 +1614,9 @@ export class BaileysStartupService extends ChannelStartupService {
// This enables LID to phoneNumber conversion without breaking existing webhook consumers
// Helper to normalize participantId as phone number
const normalizePhoneNumber = (id: string): string => {
const normalizePhoneNumber = (id: string | any): string => {
// Remove @lid, @s.whatsapp.net suffixes and extract just the number part
return id.split('@')[0];
return String(id || '').split('@')[0];
};
try {