Closed DiyRex closed 3 years ago
you could do something like this
const YouTube = require("youtube-sr").default;
const results = await YouTube.search("indila last dance", { limit: 3 });
sendMessage(results.map((m, i) => `${i+1}. ${m.title}`).join("\n"));
/*
output:
1. title
2. title
3. title
...
*/
closing due to inactivity
Im sorry for asking this. I want to know how to get the result out from the promise insted of console.log(x).
code -
const YouTube = require("youtube-sr").default; YouTube.search("indila last dance", { limit: 3 }) .then(x => console.log(x)) .catch(console.error);
in here console.log(x) working fine. but I need to send the result as reply in my whatsapp bot. I couldnt find a away to do that.