Commit 788e8154b3cfdc41b899c2ff2f2894939bf2195d

Authored by Adhidarma Hadiwinoto
1 parent d54a2eebcd
Exists in master

Detect sms nomor tujuan valid phone number tidak

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -9,7 +9,10 @@ async function send(partner, msg) {
9 9 if (typeof partner !== 'string' || typeof msg !== 'string') return;
10 10 if (!partner.trim() || !msg.trim()) return;
11 11  
12   - const destination = partner.trim().replace(/^0/, '').replace(/^\+/);
  12 + const destination = partner.trim().replace(/^0/, '62').replace(/^\+/, '');
  13 +
  14 + if (!destination || !Number(destination) || destination.length < 8) return;
  15 +
13 16 const msgFileContent = `
14 17 To: ${destination}
15 18