Skip to content

Commit

Permalink
TheMystic-Bot-MD | Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
glytglobal authored Dec 14, 2024
1 parent 46a9d1d commit d1215d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/search-npmjs.js β†’ plugins/buscador-npmjs.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/*
By GabrielVz (@glytglobal)
# Codigo creado por: GabrielVz (@glytglobal)
# https://github.com/glytglobal
*/

import fetch from 'node-fetch'

let handler = async (m, { text }) => {
if (!text) throw '*γ€Œ ❗️ 」INGRESA EL TITULO O NOMBRE DEL SCRAPER DE NMPJS A BUSCAR*\n\n*β€’ EJEMPLO:*\n> */npmjs yt-search*'
if (!text) throw `*[ ❗️ ] INGRESA EL TITULO O NOMBRE DEL SCRAPER DE NPMJS (NPM.ORG) A BUSCAR*`
let res = await fetch(`http://registry.npmjs.com/-/v1/search?text=${text}`)
let { objects } = await res.json()
if (!objects.length) throw `γ€Œ ❗️ 」 LA BUSQUEDA "${text}" NO FUE ENCONTRADA`
if (!objects.length) throw `[ ❗️ ] LA BUSQUEDA "${text}" NO FUE ENCONTRADA\n\nINTENTE CON OTRO TIPO DE RESULTADOS`
let txt = objects.map(({ package: pkg }) => {
return `
✰ ππ¨π¦π›π«πž: ${pkg.name}
Expand Down

0 comments on commit d1215d4

Please sign in to comment.