scheffin-api / src /common /utils.ts
Rasyiq03's picture
finishing
464b662
Raw History Blame Contribute Delete
354 Bytes
export function formatJid(target: string): string {
if (target.includes('@g.us') || target.includes('@s.whatsapp.net')) {
return target;
}
const cleanTarget = target.replace(/\D/g, '');
let processed = cleanTarget;
if (processed.startsWith('0')) {
processed = '62' + processed.slice(1);
}
return processed + '@s.whatsapp.net';
}