Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
sendMessage se ejecuta dos veces incluso después de que se cumpla la condición

Tengo un problema con la funcion "cari", los datos son correctos pero hay un

 txt = 'Material '+pola[1]+' tidak ditemukan atau perintah command tidak sesuai'; sendMessage(cid,txt);
todavía apareció, es decir, no es necesario que aparezca cuando los datos son correctos.
ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí

 function cari(cid,cmd){ var txt = ''; var pola = cmd.match(/cari#(.+)/); if (pola[1]!=''){ var rs = bacadata(); for (var i=0;i<rs.length;i++) { if (rs[i][0] == pola[1]){ txt = 'Material '+pola[1]+' adalah '+rs[i][1]; sendMessage(cid,txt); } } txt = 'Material '+pola[1]+' tidak ditemukan atau perintah command tidak sesuai'; sendMessage(cid,txt); } }

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Prueba sendMessage() una vez después del ciclo:

 function cari(cid,cmd){ var pola = cmd.match(/cari#(.+)/); var txt = 'Data '+pola[1]+' tidak ditemukan atau perintah command tidak sesuai...'; if (pola[1]!=''){ var rs = bacadata(); for (var i=0;i<rs.length;i++) { if (rs[i][0] == pola[1]){ txt = pola[1]+' adalah '+rs[i][1]; break; } } //end of loop sendMessage(cid,txt); } }
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!