Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error please check and see it its from the app or my making #1

Open
pitbullcan opened this issue Aug 5, 2021 · 2 comments
Open

Error please check and see it its from the app or my making #1

pitbullcan opened this issue Aug 5, 2021 · 2 comments

Comments

@pitbullcan
Copy link

pitbullcan commented Aug 5, 2021

[Work] Checking 2 number...
[0] Number: +40107900501 | Result: undefined
C:\Users\Administrator\Desktop\wpnc\index.js:70
validNumber.push({number, value: result.toString().toUpperCase()})

                                                  ^

TypeError: Cannot read property 'toString' of undefined
at Timeout._onTimeout (C:\Users\Administrator\Desktop\wpnc\index.js:70:55)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

C:\Users\Administrator\Desktop\wpnc>

noticed send_url.js is not in the directory. please can you provide

@pitbullcan
Copy link
Author

No response yet?

@salmanrajz
Copy link

Repl

No response yet?

Hi, do this replace await function with this.

await Promise.all(
numberlist.map((number, i) => new Promise((resolve, reject) => {
if (!isNaN(number) || number == '') {
setTimeout(async () => {
const contactId = number.includes('@s.whatsapp.net') ? number.trim() : number.trim() + '@s.whatsapp.net'
const result = await this.client.isOnWhatsApp(contactId)
result ? console.log([${chalk.green(i)}] Number:, number, '| Result:', result) : console.log([${chalk.red(i)}] Number:, number, '| Result:', result)
console.log(result)
if (result == undefined) {
console.log("Google");
validNumber.push({
number,
value: "Failed"
})
} else {
// console.log("Success");
validNumber.push({
number,
value: "Pass"
})
// validNumber.push({number, value: result.toUpperCase()})
}
resolve()
}, i * 100)
} else {
return res.render("index.ejs", {
error: 'nomernya ada yang salah tu'
})
}
})))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants