H
H
Httdientee2021-12-29 12:10:07
Node.js
Httdientee, 2021-12-29 12:10:07

Error when using timer?

(node:94092) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received "count_connect++;await browser.close();console.log('[!] The script has disconnected from http://instalovex.ru. Pr
oxies used');browser_connect();"

setTimeout("count_connect++;await browser.close();console.log('[!] The script has disconnected from http://instalovex.ru. Proxies used');browser_connect();", 14000);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-12-29
@Httdientee

Error when using timer?
Yes, it's a mistake, right.
If you could put questions without a question mark, would you put the heading "Error using timer"? Why is this information here?
Besides, you clearly wrote "Callback must be a function".
Line

"count_connect++;await browser.close();console.log('[!] The script has disconnected from http://instalovex.ru. Proxies used');browser_connect();"
is not a function, but a string
You need:
setTimeout(() => {
  count_connect++;
  await browser.close();
  console.log('[!] The script has disconnected from http://instalovex.ru. Proxies used');
  browser_connect();
}, 14000)

L
Lynn "Coffee Man", 2021-12-29
@Lynn

Write a function:

setTimeout(async () => {
    count_connect++;
    await browser.close();
    console.log('[!] The script has disconnected from http://instalovex.ru. Proxies used');
    browser_connect();
}, 14000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question