descargas-pinterest.js 1.1 KB

12345678910111213141516171819202122
  1. import {pinterest} from '@bochilteam/scraper';
  2. const handler = async (m, {conn, text, usedPrefix, command}) => {
  3. if (!text) throw `*⚠️ Ejemplo:* ${usedPrefix + command} Kantu`;
  4. try {
  5. const json = await pinterest(text);
  6. conn.sendFile(m.chat, json.getRandom(), 'error.jpg', `_🔎 𝙍𝙚𝙨𝙪𝙡𝙩𝙖𝙙𝙤𝙨 𝙙𝙚: ${text}_`, m, null, fake);
  7. } catch (error1) {
  8. try {
  9. const response=await fetch(`https://deliriussapi-oficial.vercel.app/search/pinterest?text=${text}`)
  10. const dataR = await response.json()
  11. const json = dataR.result
  12. conn.sendFile(m.chat, json.getRandom(), 'error.jpg', `_🔎 𝙍𝙚𝙨𝙪𝙡𝙩𝙖𝙙𝙤𝙨 𝙙𝙚: ${text}_`, m, null, fake);
  13. //conn.sendButton(m.chat, `💞 ${mid.buscador} ${text}`, `𝙋𝙞𝙣𝙩𝙚𝙧𝙚𝙨𝙩 | ${wm}`, json.getRandom(), [['🔄 𝙎𝙞𝙜𝙪𝙞𝙚𝙣𝙩𝙚 | 𝙉𝙚𝙭𝙩', `${usedPrefix}pinterest ${text}`]], null, null, m)
  14. } catch (e) {
  15. console.log(e)
  16. }}}
  17. handler.help = ['pinterest <keyword>'];
  18. handler.tags = ['buscadores'];
  19. handler.command = /^(pinterest)$/i;
  20. handler.register = true
  21. handler.limit = 1
  22. export default handler;