I want to make a whatapp bot brainly nodejs. And I want to add an argument. my code is like this:
case 'brainly':
const args = process.argv
brainly(args).then(res => {
for(var i=0; i<res.length; i++){
var jawab = res[i].jawaban
client.sendText(from, jawab[0].text)
}
})
break
But, when I run it shows an error like this:
(node:7960) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
how to fix this? Please help me.
.catch()
like the error message suggests? – Phil